]> spindle.queued.net Git - midori/commitdiff
Be sure to disconnect item notification when the proxy is destroyed
authorChristian Dywan <christian@twotoasts.de>
Mon, 30 Nov 2009 18:47:41 +0000 (19:47 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 30 Nov 2009 18:47:41 +0000 (19:47 +0100)
katze/katze-arrayaction.c

index c64def82b713c80b0bc813bff4a72a7129cc31a1..d9cf7d2c09de38645da52cbadff8b7382848ad74 100644 (file)
@@ -541,6 +541,14 @@ katze_array_action_proxy_create_menu_proxy_cb (GtkWidget* proxy,
     return TRUE;
 }
 
+static void
+katze_array_action_toolitem_destroy_cb (GtkToolItem* toolitem,
+                                        KatzeItem*   item)
+{
+    g_signal_handlers_disconnect_by_func (item,
+        G_CALLBACK (katze_array_action_item_notify_cb), toolitem);
+}
+
 /**
  * katze_array_action_create_tool_item_for:
  * @array_action: a #KatzeArrayAction
@@ -615,6 +623,8 @@ katze_array_action_create_tool_item_for (KatzeArrayAction* array_action,
     g_object_set_data (G_OBJECT (toolitem), "KatzeArrayAction", array_action);
     g_signal_connect (item, "notify",
         G_CALLBACK (katze_array_action_item_notify_cb), toolitem);
+    g_signal_connect (toolitem, "destroy",
+        G_CALLBACK (katze_array_action_toolitem_destroy_cb), item);
     return toolitem;
 }