diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2017-03-04 13:28:19 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2017-03-05 19:42:38 -0600 |
commit | aef6ff196a303e692dde3225cdc0ca5ccf3a5711 (patch) | |
tree | 70af94f14133ad9605767aaa0534da685c756796 | |
parent | 0d2198ab4f0c507e1042a0f16cc726df088d81f4 (diff) | |
download | epiphany-gnome-3-20.tar.gz |
embed: avoid memory corruption when clearing top widgetsgnome-3-20
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
-rw-r--r-- | embed/ephy-embed.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 1069abc12..15a86b42d 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -218,15 +218,6 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id) } 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) { GSList *list; @@ -237,6 +228,19 @@ remove_from_destroy_list_cb (GtkWidget *widget, EphyEmbed *embed) } 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) { |