diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-11-02 19:01:13 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-11-02 19:03:33 +0100 |
commit | 1dc416887bf1e88c4b49bd1ac2101e0fb8460af8 (patch) | |
tree | 5260be972345c9c83ce9c8647c67d8b6bb4ca1e9 | |
parent | 87a7735cd310b03811610c79edb4b5cdfaa91d76 (diff) | |
download | nautilus-1dc416887bf1e88c4b49bd1ac2101e0fb8460af8.tar.gz |
pathbar: fix crasher when unmounting volumes (#627901)
-rw-r--r-- | src/nautilus-pathbar.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index a9e7adcce..24478b90a 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -1571,14 +1571,19 @@ button_data_file_changed (NautilusFile *file, } else if (nautilus_file_is_gone (file)) { gint idx, position; - /* remove this and the following buttons */ - position = g_list_position (path_bar->button_list, - g_list_find (path_bar->button_list, button_data)); - - if (position != -1) { - for (idx = 0; idx <= position; idx++) { - gtk_container_remove (GTK_CONTAINER (path_bar), - BUTTON_DATA (path_bar->button_list->data)->button); + /* if the current location is gone, don't do anything, as the view + * will get the event too and call us back. + */ + if (nautilus_file_compare_location (file, current_button_data->file) != 0) { + /* remove this and the following buttons */ + position = g_list_position (path_bar->button_list, + g_list_find (path_bar->button_list, button_data)); + + if (position != -1) { + for (idx = 0; idx <= position; idx++) { + gtk_container_remove (GTK_CONTAINER (path_bar), + BUTTON_DATA (path_bar->button_list->data)->button); + } } } |