From 0da785e94cea24c6b52180ad993d940046029775 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 19 Aug 2009 23:51:59 +0200 Subject: [PATCH] Disconnect bookmark folder signals, for bookmarkbar and panel This would lead to crashes when opening and closing windows and attempting to add bookmarks afterwards. --- midori/midori-browser.c | 15 +++++++++++++++ panels/midori-bookmarks.c | 1 + 2 files changed, 16 insertions(+) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 3cc7b8ca..e03ea7ef 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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); diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 93f1c81c..0196eda2 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -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); -- 2.39.5