[PATCH] Disconnect manually connected proxy signals



The attached patch fixes a crasher I experienced today.

-- 
Christian Neumair <chris gnome-de org>
Index: src/nautilus-navigation-action.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-navigation-action.c,v
retrieving revision 1.3
diff -u -p -r1.3 nautilus-navigation-action.c
--- src/nautilus-navigation-action.c	27 May 2005 10:37:54 -0000	1.3
+++ src/nautilus-navigation-action.c	2 May 2006 10:38:44 -0000
@@ -210,6 +210,17 @@ connect_proxy (GtkAction *action, GtkWid
 }
 
 static void
+disconnect_proxy (GtkAction *action, GtkWidget *proxy)
+{
+	if (GTK_IS_MENU_TOOL_BUTTON (proxy)) {
+		g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (set_tooltip_callback), action);
+		g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (show_menu_callback), action);
+	}
+
+	(* GTK_ACTION_CLASS (parent_class)->disconnect_proxy) (action, proxy);
+}
+
+static void
 nautilus_navigation_action_finalize (GObject *object)
 {
 	NautilusNavigationAction *action = NAUTILUS_NAVIGATION_ACTION (object);
@@ -282,6 +293,7 @@ nautilus_navigation_action_class_init (N
 
 	action_class->toolbar_item_type = GTK_TYPE_MENU_TOOL_BUTTON;
 	action_class->connect_proxy = connect_proxy;
+	action_class->disconnect_proxy = disconnect_proxy;
 
 	g_object_class_install_property (object_class,
                                          PROP_ARROW_TOOLTIP,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]