All pastes #33916 Raw Edit

Someone

public text v1 · immutable
#33916 ·published 2005-12-16 20:26 UTC
rendered paste body
Index: src/gdict-app.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/gnome-dictionary/src/gdict-app.c,v
retrieving revision 1.2
diff -u -p -r1.2 gdict-app.c
--- src/gdict-app.c	16 Dec 2005 17:36:02 -0000	1.2
+++ src/gdict-app.c	16 Dec 2005 20:25:50 -0000
@@ -109,21 +109,15 @@ gdict_window_destroy_cb (GtkWidget *widg
   GSList *l;
   
   g_assert (GDICT_IS_APP (app));
-  
-  for (l = app->windows; l != NULL; l = l->next)
-    {
-      GdictWindow *w = GDICT_WINDOW (l->data);
-      
-      if (w->window_id == window->window_id)
-        {
-          app->windows = g_slist_remove_link (app->windows, l);
-          g_slist_free (l);
 
-          break;
-        }
+  app->windows = g_slist_remove (app->windows, widget);
+
+  if (GDICT_WINDOW (widget) == app->current_window)
+    {
+      app->current_window = app->windows ? app->windows->data : NULL;
     }
 
-  if (g_slist_length (app->windows) == 0)
+  if (app->windows == NULL)
     gtk_main_quit ();
 }