Index: gdkgeometry-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkgeometry-x11.c,v
retrieving revision 1.18
diff -u -p -u -r1.18 gdkgeometry-x11.c
--- gdkgeometry-x11.c	19 Aug 2003 18:32:12 -0000	1.18
+++ gdkgeometry-x11.c	2 Feb 2004 21:48:34 -0000
@@ -914,7 +914,11 @@ queue_delete_link (GQueue *queue,
 static void
 queue_item_free (GdkWindowQueueItem *item)
 {
-  g_object_unref (item->window);
+  if (item->window)
+    {
+      g_object_remove_weak_pointer (G_OBJECT (item->window),
+				    (gpointer *)&(item->window));
+    }
   
   if (item->type == GDK_WINDOW_QUEUE_ANTIEXPOSE)
     gdk_region_destroy (item->u.antiexpose.area);
@@ -979,12 +983,13 @@ gdk_window_queue (GdkWindow          *wi
 	  tmp_list = next;
 	}
     }
-      
-  g_object_ref (window);
 
   item->window = window;
   item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window));
   
+  g_object_add_weak_pointer (G_OBJECT (window),
+			     (gpointer *)&(item->window));
+
   g_queue_push_tail (display_x11->translate_queue, item);
 }
 
