summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-12-02 16:09:02 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2011-12-02 16:24:00 -0500
commit3af92d82af54280df73a38855d6ccfe09dbd5709 (patch)
treed113892a7b66b6949a8b6b6061c8630a865d9a70
parentf6c483366c861d134c687eb4cb3ef833c1951cac (diff)
downloadnautilus-3af92d82af54280df73a38855d6ccfe09dbd5709.tar.gz
window: explicitly destroy the sidebar in _destroy()
When the nautilus window is destroyed, make sure to explicitly destroy the sidebar before the panes. Destroying all the panes can trigger a callback back into the sidebar, which would then try to access the window pane list from the callback. The pane list was already destroyed and cleared at that point though, and we would segfault. https://bugzilla.gnome.org/show_bug.cgi?id=652320
-rw-r--r--src/nautilus-window.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 68dc93fb3..c3a3c2c94 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -473,8 +473,10 @@ nautilus_window_tear_down_sidebar (NautilusWindow *window)
{
DEBUG ("Destroying sidebar");
- gtk_widget_destroy (GTK_WIDGET (window->details->sidebar));
- window->details->sidebar = NULL;
+ if (window->details->sidebar != NULL) {
+ gtk_widget_destroy (GTK_WIDGET (window->details->sidebar));
+ window->details->sidebar = NULL;
+ }
}
void
@@ -720,8 +722,8 @@ nautilus_window_destroy (GtkWidget *object)
DEBUG ("Destroying window");
- window->details->content_paned = NULL;
- window->details->split_view_hpane = NULL;
+ /* close the sidebar first */
+ nautilus_window_tear_down_sidebar (window);
/* close all panes safely */
panes_copy = g_list_copy (window->details->panes);