[Xfce4-commits] <midori:master> Disconnect settings and bookmarkbar when disposing

Christian Dywan noreply at xfce.org
Fri Jul 30 22:12:01 CEST 2010


Updating branch refs/heads/master
         to 2350fc0834ca4c174bf16ff8e21bad82184eec7e (commit)
       from 1dac2e6d9f2768853cb7773a2e0c6894866a9e39 (commit)

commit 2350fc0834ca4c174bf16ff8e21bad82184eec7e
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Jul 29 15:03:18 2010 +0200

    Disconnect settings and bookmarkbar when disposing

 midori/midori-browser.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 0ee09e0..1ac1d40 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -5968,6 +5968,10 @@ midori_browser_dispose (GObject* object)
 
     /* We are done, the session mustn't change anymore */
     katze_object_assign (browser->proxy_array, NULL);
+    g_signal_handlers_disconnect_by_func (browser->settings,
+                                          midori_browser_settings_notify,
+                                          browser);
+    midori_browser_set_bookmarks (browser, NULL);
 
     G_OBJECT_CLASS (midori_browser_parent_class)->dispose (object);
 }
@@ -5977,14 +5981,9 @@ midori_browser_finalize (GObject* object)
 {
     MidoriBrowser* browser = MIDORI_BROWSER (object);
 
-    g_signal_handlers_disconnect_by_func (browser->settings,
-                                          midori_browser_settings_notify,
-                                          browser);
-
     katze_assign (browser->statusbar_text, NULL);
 
     katze_object_assign (browser->settings, NULL);
-    katze_object_assign (browser->bookmarks, NULL);
     katze_object_assign (browser->trash, NULL);
     katze_object_assign (browser->search_engines, NULL);
     katze_object_assign (browser->history, NULL);
@@ -6448,16 +6447,15 @@ midori_browser_set_bookmarks (MidoriBrowser* browser,
 {
     MidoriWebSettings* settings;
 
+    settings = midori_browser_get_settings (browser);
+    g_signal_handlers_disconnect_by_func (settings,
+        midori_browser_show_bookmarkbar_notify_value_cb, browser);
+    katze_object_assign (browser->bookmarks, bookmarks);
+
     if (!bookmarks)
         return;
 
-    if (!browser->bookmarks)
-    {
-        g_object_ref (bookmarks);
-        katze_object_assign (browser->bookmarks, bookmarks);
-    }
-
-    settings = midori_browser_get_settings (browser);
+    g_object_ref (bookmarks);
     g_signal_connect (settings, "notify::show-bookmarkbar",
         G_CALLBACK (midori_browser_show_bookmarkbar_notify_value_cb), browser);
     g_object_notify (G_OBJECT (settings), "show-bookmarkbar");



More information about the Xfce4-commits mailing list