]> spindle.queued.net Git - midori/commitdiff
Disconnect panel toolitem destroy handler when detaching
authorChristian Dywan <christian@twotoasts.de>
Sun, 26 Apr 2009 15:11:16 +0000 (17:11 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 26 Apr 2009 15:11:16 +0000 (17:11 +0200)
midori/midori-panel.c

index 8c2fa0bbe7f6932831df53d955f97858e6ea5eb8..e96bc600d4a0333ce39abaf7b5462e47adcb8f25 100644 (file)
@@ -218,6 +218,15 @@ midori_panel_detached_window_delete_event_cb (GtkWidget*   window,
     return FALSE;
 }
 
+static void
+midori_panel_widget_destroy_cb (GtkWidget* viewable,
+                                GtkWidget* widget)
+{
+    gtk_widget_destroy (widget);
+    g_signal_handlers_disconnect_by_func (
+        viewable, midori_panel_widget_destroy_cb, widget);
+}
+
 static void
 midori_panel_button_detach_clicked_cb (GtkWidget*   toolbutton,
                                        MidoriPanel* panel)
@@ -246,6 +255,9 @@ midori_panel_button_detach_clicked_cb (GtkWidget*   toolbutton,
     gtk_container_add (GTK_CONTAINER (window), vbox);
     if (menuitem)
         gtk_widget_hide (menuitem);
+    g_signal_handlers_disconnect_by_func (
+        _midori_panel_child_for_scrolled (panel, scrolled),
+        midori_panel_widget_destroy_cb, toolitem);
     gtk_container_remove (GTK_CONTAINER (panel->toolbar), GTK_WIDGET (toolitem));
     g_object_ref (toolbar);
     gtk_container_remove (GTK_CONTAINER (panel->toolbook), toolbar);
@@ -537,15 +549,6 @@ midori_panel_viewable_destroy_cb (GtkWidget*   viewable,
         viewable, midori_panel_viewable_destroy_cb, panel);
 }
 
-static void
-midori_panel_widget_destroy_cb (GtkWidget* viewable,
-                                GtkWidget* widget)
-{
-    gtk_widget_destroy (widget);
-    g_signal_handlers_disconnect_by_func (
-        viewable, midori_panel_widget_destroy_cb, widget);
-}
-
 static GtkToolItem*
 midori_panel_construct_tool_item (MidoriPanel*    panel,
                                   MidoriViewable* viewable)