diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2004-02-02 23:26:55 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2004-02-02 23:26:55 +0000 |
commit | 01440e457e1048196a412d786b4cce4f238002a2 (patch) | |
tree | b28c3aa0b4242d04da5ca37e7dbe22313279b371 /gdk | |
parent | 4ec8e2b20e9e9dc4dcf3a4c789390cfe50455075 (diff) | |
download | gdk-pixbuf-01440e457e1048196a412d786b4cce4f238002a2.tar.gz |
Use a weak reference instead of ref()/unref(). (#60857, reported by Joshua
Tue Feb 3 00:14:36 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gdk/x11/gdkgeometry-x11.c (queue_item_free, gdk_window_queue):
Use a weak reference instead of ref()/unref(). (#60857, reported
by Joshua N Pritikin)
* gdk/gdkimage.c (scratch_image_info_for_depth): Formatting fix.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkimage.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkgeometry-x11.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c index 61ac976bd..c7ef2efd9 100644 --- a/gdk/gdkimage.c +++ b/gdk/gdkimage.c @@ -247,7 +247,7 @@ scratch_image_info_for_depth (GdkScreen *screen, image_info->depth = depth; image_info->screen = screen; - /* Try to allocate as few possible shared images */ + /* Try to allocate as few possible shared images */ for (i=0; i < G_N_ELEMENTS (possible_n_images); i++) { if (allocate_scratch_images (image_info, possible_n_images[i], TRUE)) diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c index 16480277d..0ad1b5d64 100644 --- a/gdk/x11/gdkgeometry-x11.c +++ b/gdk/x11/gdkgeometry-x11.c @@ -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 *window, 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); } |