Patch for #85216 - reproducible crasher in EOG



This is a reproducible crasher in EOG when you exit your session.  Some
list handling foo and whatnot.

Please see http://bugzilla.gnome.org/show_bug.cgi?id=85216 for the full
bug report.

Is this patch OK to commit?

[I want to branch EOG really soon, btw...]

  Federico


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/eog/ChangeLog,v
retrieving revision 1.223
diff -u -r1.223 ChangeLog
--- ChangeLog	13 Jun 2002 19:58:24 -0000	1.223
+++ ChangeLog	14 Jun 2002 00:14:15 -0000
@@ -1,3 +1,12 @@
+2002-06-13  Federico Mena Quintero  <federico ximian com>
+
+	* shell/eog-window.c (eog_window_destroy): Remove the window from
+	the window list here, not in eog_window_close().
+
+	* shell/main.c (client_die_cb): Use eog_window_close() rather than
+	gtk_widget_destroy() to close the windows.  This will terminate
+	the main loop when appropriate.
+
 2002-06-12  Federico Mena Quintero  <federico ximian com>
 
 	* shell/main.c (sort_startup_files): Create a list of filenames
Index: shell/eog-window.c
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.c,v
retrieving revision 1.60
diff -u -r1.60 eog-window.c
--- shell/eog-window.c	31 May 2002 15:50:35 -0000	1.60
+++ shell/eog-window.c	14 Jun 2002 00:14:15 -0000
@@ -94,7 +94,7 @@
 static BonoboWindowClass *parent_class;
 
 /* The list of all open windows */
-static GList *window_list;
+static GList *window_list = NULL;
 
 /* Drag target types */
 enum {
@@ -382,12 +382,11 @@
 	g_return_if_fail (object != NULL);
 	g_return_if_fail (EOG_IS_WINDOW (object));
 
-	if (getenv ("DEBUG_EOG"))
-		g_message ("Destroying EogWindow...");
-
 	window = EOG_WINDOW (object);
 	priv = window->priv;
 
+	window_list = g_list_remove (window_list, window);
+
 	if (priv->uri) {
 		g_free (priv->uri);
 		priv->uri = NULL;
@@ -754,8 +753,6 @@
 {
 	g_return_if_fail (window != NULL);
 	g_return_if_fail (EOG_IS_WINDOW (window));
-
-	window_list = g_list_remove (window_list, window);
 
 	gtk_widget_destroy (GTK_WIDGET (window));
 
Index: shell/main.c
===================================================================
RCS file: /cvs/gnome/eog/shell/main.c,v
retrieving revision 1.21
diff -u -r1.21 main.c
--- shell/main.c	13 Jun 2002 19:58:28 -0000	1.21
+++ shell/main.c	14 Jun 2002 00:14:15 -0000
@@ -428,17 +428,17 @@
 static void
 client_die_cb (GnomeClient *client, gpointer data)
 {
-	GList *l;
+	while (1) {
+		GList *l;
+		EogWindow *window;
 
-	do {
 		l = eog_get_window_list ();
-		if (l) {
-			EogWindow *window;
+		if (!l)
+			break;
 
-			window = EOG_WINDOW (l->data);
-			gtk_widget_destroy (GTK_WIDGET (window));
-		}
-	} while (l);
+		window = EOG_WINDOW (l->data);
+		eog_window_close (window);
+	}
 }
 
 int


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