[PATCH] list view crasher (#151493)



I had a look at the crasher I introduced with my patch for #143830, and
fortunately the fix is pretty simple: gtk_cell_editable_editing_done()
must not be called if the model was NULLed already (doh!). This is the
case when fm_clear_list_view() is called during the view destruction.
I did some testing and if it looks ok to the maintainers, I'll request a
freeze break.

Martin

Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.227
diff -u -p -r1.227 fm-list-view.c
--- src/file-manager/fm-list-view.c	18 Aug 2004 22:53:34 -0000	1.227
+++ src/file-manager/fm-list-view.c	3 Sep 2004 01:20:34 -0000
@@ -1280,18 +1280,18 @@ fm_list_view_clear (FMDirectoryView *vie
 
 	list_view = FM_LIST_VIEW (view);
 
-	/* Stop an ongoing rename to commit the name changes when the user
-	 * changes directories without exiting cell edit mode. It also prevents
-	 * the edited handler from being called on the cleared list model.
-	 */
+	if (list_view->details->model != NULL) {
+		/* Stop an ongoing rename to commit the name changes when the user
+		 * changes directories without exiting cell edit mode. It also prevents
+		 * the edited handler from being called on the cleared list model.
+		 */
 
-	column = list_view->details->file_name_column;
-	if (column != NULL && column->editable_widget != NULL &&
-		GTK_IS_CELL_EDITABLE (column->editable_widget)) {
-		gtk_cell_editable_editing_done (column->editable_widget);
-	}
+		column = list_view->details->file_name_column;
+		if (column != NULL && column->editable_widget != NULL &&
+			GTK_IS_CELL_EDITABLE (column->editable_widget)) {
+			gtk_cell_editable_editing_done (column->editable_widget);
+		}
 
-	if (list_view->details->model != NULL) {
 		fm_list_model_clear (list_view->details->model);
 	}
 }


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