[nautilus] pathbar: fix crasher when unmounting volumes (#627901)



commit 373683da693e6f4a768c7eb6f1fc793315c23db7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Nov 2 19:01:13 2010 +0100

    pathbar: fix crasher when unmounting volumes (#627901)

 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 3c8da68..a4140c7 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1601,14 +1601,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);
+				}
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]