← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~mterry/dbusmenu/disconnect-when-done into lp:dbusmenu

 

Michael Terry has proposed merging lp:~mterry/dbusmenu/disconnect-when-done into lp:dbusmenu.

Requested reviews:
  DBus Menu Team (dbusmenu-team)

For more details, see:
https://code.launchpad.net/~mterry/dbusmenu/disconnect-when-done/+merge/48361

When debugging shotwell interaction with the appmenu, I came across this crasher bug (crasher on the shotwell side, not the appmenu side) caused by dbusmenu.

Shotwell was doing some funky stuff like swapping out whole menubars, and one side effect is that it was calling label_notify_cb even when the menuitem that set up the signal was destroyed.

So a fix that worked for me was to disconnect signals appropriately when the menuitem is going down.
-- 
https://code.launchpad.net/~mterry/dbusmenu/disconnect-when-done/+merge/48361
Your team ayatana-commits is subscribed to branch lp:dbusmenu.
=== modified file 'libdbusmenu-gtk/parser.c'
--- libdbusmenu-gtk/parser.c	2011-01-31 18:08:57 +0000
+++ libdbusmenu-gtk/parser.c	2011-02-02 18:49:13 +0000
@@ -102,6 +102,21 @@
 	   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;
 }
 


Follow ups