summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-03-29 15:49:04 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2011-03-29 16:44:01 -0400
commitcf21e9aa47c67861422ada02c7fa327340d63140 (patch)
treee46b8dfaf01fffa9d3b9c199ab90393229e9dd25
parentaed2cce6c36543457f5f1ad8f8c05f2fa147b1f2 (diff)
downloadnautilus-cf21e9aa47c67861422ada02c7fa327340d63140.tar.gz
pathbar: keep a ref to the GFile while updating the path
When desktop-is-home-dir changes, we force a re-layout of all the buttons, which in turn unrefs the passed-in GFile, as the ref would belong to an old button. Fix this by assuming a ref while calling nautilus_path_bar_update_path(). https://bugzilla.gnome.org/show_bug.cgi?id=551543
-rw-r--r--src/nautilus-pathbar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index c922565ee..ec74203c2 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -137,12 +137,13 @@ update_button_types (NautilusPathBar *path_bar)
ButtonData *button_data;
button_data = BUTTON_DATA (list->data);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button))) {
- path = button_data->path;
+ path = g_object_ref (button_data->path);
break;
}
}
if (path != NULL) {
nautilus_path_bar_update_path (path_bar, path, TRUE);
+ g_object_unref (path);
}
}