From ec92c64dffaffd544e8bd2500647620ddebd6f45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20St=C3=B6sel?= Date: Mon, 5 Sep 2011 18:02:42 +0200 Subject: [PATCH] Don't switch panels while destroying Fixes: https://bugs.launchpad.net/midori/+bug/819688 --- midori/midori-panel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/midori/midori-panel.c b/midori/midori-panel.c index a7abc81a..fb3c66f1 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -13,6 +13,8 @@ #include "midori-view.h" +#include "midori-browser.h" + #include "marshal.h" #include "sokoke.h" @@ -588,6 +590,7 @@ static void midori_panel_viewable_destroy_cb (GtkWidget* viewable, MidoriPanel* panel) { + MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (panel)); gint n_pages; gchar* action_name; GtkAction* action; @@ -601,7 +604,7 @@ midori_panel_viewable_destroy_cb (GtkWidget* viewable, viewable, midori_panel_viewable_destroy_cb, panel); n_pages = midori_panel_get_n_pages (panel); - if (n_pages > 0) + if (n_pages > 0 && browser && !g_object_get_data (G_OBJECT (browser), "midori-browser-destroyed")) midori_panel_set_current_page (panel, (n_pages-1 > i) ? i : n_pages - 1); action_name = g_strconcat ("PanelPage", -- 2.39.5