diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2009-10-01 19:23:37 +0300 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2009-10-01 19:55:06 +0300 |
commit | 92898106333744c340516845d69e6a167b3941d9 (patch) | |
tree | 6818bd88f9c6f3a4a7c103a9e5ad4f350f6fa82f | |
parent | f02d4d400fd03e9d3f01e00a37068bfba637cfea (diff) |
Fix HildonAppMenu crasher during destruction
* hildon/hildon-app-menu.c: (+hildon_app_menu_dispose):
Remove the weak references to the menu and filters to avoid
emitting the "changed" signal during destruction.
Fixes: NB#141367 (Reproducible browser crash)
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | hildon/hildon-app-menu.c | 23 |
2 files changed, 33 insertions, 0 deletions
@@ -1,3 +1,13 @@ +2009-10-01 Claudio Saavedra <csaavedra@igalia.com> + + Fix HildonAppMenu crasher during destruction + + * hildon/hildon-app-menu.c: (+hildon_app_menu_dispose): + Remove the weak references to the menu and filters to avoid + emitting the "changed" signal during destruction. + + Fixes: NB#141367 (Reproducible browser crash) + 2009-09-23 Claudio Saavedra <csaavedra@igalia.com> * hildon/hildon-note.c: Declare hildon_note_set_padding() only when using diff --git a/hildon/hildon-app-menu.c b/hildon/hildon-app-menu.c index e7a7694..6c337d4 100644 --- a/hildon/hildon-app-menu.c +++ b/hildon/hildon-app-menu.c @@ -969,6 +969,28 @@ hildon_app_menu_init (HildonAppMenu *menu) gtk_widget_show_all (GTK_WIDGET (priv->vbox)); } + +static void +disconnect_weak_refs (gpointer data, + gpointer user_data) +{ + g_object_weak_unref (G_OBJECT (data), + (GWeakNotify) emit_menu_changed, + user_data); +} + +static void +hildon_app_menu_dispose (GObject *object) + +{ + HildonAppMenuPrivate *priv = HILDON_APP_MENU_GET_PRIVATE(object); + + g_list_foreach (priv->buttons, (GFunc) disconnect_weak_refs, object); + g_list_foreach (priv->filters, (GFunc) disconnect_weak_refs, object); + + G_OBJECT_CLASS (hildon_app_menu_parent_class)->dispose (object); +} + static void hildon_app_menu_finalize (GObject *object) { @@ -1008,6 +1030,7 @@ hildon_app_menu_class_init (HildonAppMenuClass *klass) GObjectClass *gobject_class = (GObjectClass *)klass; GtkWidgetClass *widget_class = (GtkWidgetClass *)klass; + gobject_class->dispose = hildon_app_menu_dispose; gobject_class->finalize = hildon_app_menu_finalize; widget_class->show_all = hildon_app_menu_show_all; widget_class->hide_all = hildon_app_menu_hide_all; |