]> spindle.queued.net Git - midori/commitdiff
Disconnect bookmark folder signals, for bookmarkbar and panel
authorChristian Dywan <christian@twotoasts.de>
Wed, 19 Aug 2009 21:51:59 +0000 (23:51 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 19 Aug 2009 21:51:59 +0000 (23:51 +0200)
This would lead to crashes when opening and closing windows and
attempting to add bookmarks afterwards.

midori/midori-browser.c
panels/midori-bookmarks.c

index 3cc7b8ca041b538755c15f01f45a58ccd772805d..e03ea7ef7f6e7ee15e6813ad5724bc5c09f197d3 100644 (file)
@@ -175,6 +175,10 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings,
                                 GParamSpec*        pspec,
                                 MidoriBrowser*     browser);
 
+static void
+midori_browser_set_bookmarks (MidoriBrowser* browser,
+                              KatzeArray*    bookmarks);
+
 static GtkAction*
 _action_by_name (MidoriBrowser* browser,
                  const gchar*   name)
@@ -4512,6 +4516,9 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser,
 static void
 midori_browser_destroy_cb (MidoriBrowser* browser)
 {
+    if (browser->bookmarks)
+        midori_browser_set_bookmarks (browser, NULL);
+
     if (G_UNLIKELY (browser->panel_timeout))
         g_source_remove (browser->panel_timeout);
     if (G_UNLIKELY (browser->alloc_timeout))
@@ -5706,6 +5713,14 @@ midori_browser_set_bookmarks (MidoriBrowser* browser,
     if (browser->bookmarks == bookmarks)
         return;
 
+    if (browser->bookmarks)
+    {
+        g_signal_handlers_disconnect_by_func (
+            browser->bookmarks, browser_bookmarks_add_item_cb, browser->bookmarkbar);
+        g_signal_handlers_disconnect_by_func (
+            browser->bookmarks, browser_bookmarks_remove_item_cb, browser->bookmarkbar);
+    }
+
     if (bookmarks)
         g_object_ref (bookmarks);
     katze_object_assign (browser->bookmarks, bookmarks);
index 93f1c81c5c0fde4010c15d089cd9d66bb513acdd..0196eda2b51c2e2c889122babb2e58b7d7e8f0bf 100644 (file)
@@ -935,6 +935,7 @@ midori_bookmarks_finalize (GObject* object)
 {
     MidoriBookmarks* bookmarks = MIDORI_BOOKMARKS (object);
 
+    midori_bookmarks_disconnect_folder (bookmarks, bookmarks->array);
     if (bookmarks->app)
         g_object_unref (bookmarks->app);
     g_object_unref (bookmarks->net);