Commit 9f4e3e6c authored by Michael Catanzaro's avatar Michael Catanzaro

embed: avoid memory corruption when clearing top widgets

Don't call remove_from_destroy_list_cb, which modifies the destroy list,
when already iterating through the list.

https://bugzilla.gnome.org/show_bug.cgi?id=779180
parent 6b6c6741
......@@ -221,15 +221,6 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id)
ephy_embed_statusbar_update (embed, msg ? msg->text : NULL);
}
static void
ephy_embed_destroy_top_widgets (EphyEmbed *embed)
{
GSList *iter;
for (iter = embed->destroy_on_transition_list; iter; iter = iter->next)
gtk_widget_destroy (GTK_WIDGET (iter->data));
}
static void
remove_from_destroy_list_cb (GtkWidget *widget, EphyEmbed *embed)
{
......@@ -240,6 +231,19 @@ remove_from_destroy_list_cb (GtkWidget *widget, EphyEmbed *embed)
embed->destroy_on_transition_list = list;
}
static void
ephy_embed_destroy_top_widgets (EphyEmbed *embed)
{
GSList *iter;
for (iter = embed->destroy_on_transition_list; iter; iter = iter->next) {
g_signal_handlers_disconnect_by_func (iter->data, remove_from_destroy_list_cb, embed);
gtk_widget_destroy (GTK_WIDGET (iter->data));
}
embed->destroy_on_transition_list = NULL;
}
static void
ephy_embed_set_title (EphyEmbed *embed,
const char *title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment