From 5193790004f2339e19b1aaf10356c493b4e6c14d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 9 Aug 2009 15:07:09 +0200 Subject: [PATCH] Protect panel property notifications and disconnect the callback Failure to do this could cause new windows to freeze and invalid pointer access after closing windows. --- midori/midori-browser.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index ede9e16b..9413f77c 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -5287,6 +5287,11 @@ midori_browser_finalize (GObject* object) { MidoriBrowser* browser = MIDORI_BROWSER (object); + if (browser->settings) + 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); @@ -5556,11 +5561,23 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings, else if (name == g_intern_string ("toolbar-items")) _midori_browser_set_toolbar_items (browser, g_value_get_string (&value)); else if (name == g_intern_string ("compact-sidepanel")) + { + g_signal_handlers_block_by_func (browser->panel, + midori_panel_notify_show_titles_cb, browser); g_object_set (browser->panel, "show-titles", !g_value_get_boolean (&value), NULL); - else if (name == g_intern_string ("show-controls")) + g_signal_handlers_unblock_by_func (browser->panel, + midori_panel_notify_show_titles_cb, browser); + } + else if (name == g_intern_string ("show-panel-controls")) + { + g_signal_handlers_block_by_func (browser->panel, + midori_panel_notify_show_controls_cb, browser); g_object_set (browser->panel, "show-controls", g_value_get_boolean (&value), NULL); + g_signal_handlers_unblock_by_func (browser->panel, + midori_panel_notify_show_controls_cb, browser); + } else if (name == g_intern_string ("always-show-tabbar")) _toggle_tabbar_smartly (browser); else if (name == g_intern_string ("show-navigationbar")) -- 2.39.5