aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-02-02 13:44:53 -0500
committerMichael Terry <mike@mterry.name>2011-02-02 13:44:53 -0500
commita3da704b473f3ab75786501a6ec20d7b735fe8d9 (patch)
tree4aa773363e6986046795a7edf9e39aed1aafe31f
parentcd7a287de9d00f258d720a745ebdb840d3b31b67 (diff)
downloadlibdbusmenu-a3da704b473f3ab75786501a6ec20d7b735fe8d9.tar.gz
libdbusmenu-a3da704b473f3ab75786501a6ec20d7b735fe8d9.tar.bz2
libdbusmenu-a3da704b473f3ab75786501a6ec20d7b735fe8d9.zip
disconnect signals when done with menuitem
-rw-r--r--libdbusmenu-gtk/parser.c15
1 files changed, 15 insertions, 0 deletions
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;
}