From a3da704b473f3ab75786501a6ec20d7b735fe8d9 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 2 Feb 2011 13:44:53 -0500 Subject: disconnect signals when done with menuitem --- libdbusmenu-gtk/parser.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 7e5e7e1..317dba2 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -102,6 +102,21 @@ dbusmenu_cache_freed (gpointer data, GObject * obj) the weak ref as well. */ g_object_steal_data(G_OBJECT(data), CACHED_MENUITEM); g_signal_handlers_disconnect_by_func(data, G_CALLBACK(widget_notify_cb), obj); + + GtkWidget *widget = GTK_WIDGET(data); + GtkWidget *label = find_menu_label (widget); + if (label != NULL) { + g_signal_handlers_disconnect_by_func(label, G_CALLBACK(label_notify_cb), obj); + } + + if (GTK_IS_ACTIVATABLE (widget)) { + GtkAction *action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget)); + + if (action) { + g_signal_handlers_disconnect_by_func(action, G_CALLBACK(action_notify_cb), obj); + } + } + return; } -- cgit v1.2.3