[epiphany] embed: avoid memory corruption when clearing top widgets
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] embed: avoid memory corruption when clearing top widgets
- Date: Sat, 4 Mar 2017 19:30:18 +0000 (UTC)
commit 9f4e3e6ca127daa756edd9ae4b8838434fd89bee
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Mar 4 13:28:19 2017 -0600
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
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 679cd91..efe7c05 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -222,15 +222,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;
@@ -241,6 +232,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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]