diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-08-15 17:05:00 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-08-15 17:05:00 +0000 |
commit | c74f0bbf6576767d4918f70e85b59e6c73d92da7 (patch) | |
tree | 549ce8c3d18f52fb2d6f310766352de126137bc8 | |
parent | aa62affea8b8eed4bc260f0f9dc8979a2169ff04 (diff) | |
download | gdk-pixbuf-c74f0bbf6576767d4918f70e85b59e6c73d92da7.tar.gz |
Don't leak ShmPixmapInfo. (#349858, Chris Wilson)
2006-08-15 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkdrawable-x11.c (get_shm_pixmap_for_image): Don't
leak ShmPixmapInfo. (#349858, Chris Wilson)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | gdk/x11/gdkdrawable-x11.c | 20 |
3 files changed, 30 insertions, 2 deletions
@@ -1,5 +1,11 @@ 2006-08-15 Matthias Clasen <mclasen@redhat.com> + * gdk/x11/gdkdrawable-x11.c (get_shm_pixmap_for_image): Don't + leak ShmPixmapInfo. (#349858, Chris Wilson) + + * gtk/Makefile.am (GTK_PRINT_PREVIEW_COMMAND): Call evince + with the --preview option. (#350139, Carlos Garcia Campos) + * modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option): Simplify, make it build against cups 1.1. (#350329) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0d134adb7..847440faf 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ 2006-08-15 Matthias Clasen <mclasen@redhat.com> + * gdk/x11/gdkdrawable-x11.c (get_shm_pixmap_for_image): Don't + leak ShmPixmapInfo. (#349858, Chris Wilson) + + * gtk/Makefile.am (GTK_PRINT_PREVIEW_COMMAND): Call evince + with the --preview option. (#350139, Carlos Garcia Campos) + * modules/printbackends/cups/gtkprintbackendcups.c (create_pickone_option): Simplify, make it build against cups 1.1. (#350329) diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c index 92278aead..67ba37ca8 100644 --- a/gdk/x11/gdkdrawable-x11.c +++ b/gdk/x11/gdkdrawable-x11.c @@ -1257,12 +1257,26 @@ typedef struct _ShmPixmapInfo ShmPixmapInfo; struct _ShmPixmapInfo { - GdkImage *image; + Display *display; Pixmap pix; Picture pict; Picture mask; }; +static void +shm_pixmap_info_destroy (gpointer data) +{ + ShmPixmapInfo *info = data; + + if (info->pict != None) + XRenderFreePicture (info->display, info->pict); + if (info->mask != None) + XRenderFreePicture (info->display, info->mask); + + g_free (data); +} + + /* Returns FALSE if we can't get a shm pixmap */ static gboolean get_shm_pixmap_for_image (Display *xdisplay, @@ -1287,6 +1301,7 @@ get_shm_pixmap_for_image (Display *xdisplay, return FALSE; info = g_new (ShmPixmapInfo, 1); + info->display = xdisplay; info->pix = *pix; info->pict = XRenderCreatePicture (xdisplay, info->pix, @@ -1297,7 +1312,8 @@ get_shm_pixmap_for_image (Display *xdisplay, else info->mask = None; - g_object_set_data (G_OBJECT (image), "gdk-x11-shm-pixmap", info); + g_object_set_data_full (G_OBJECT (image), "gdk-x11-shm-pixmap", info, + shm_pixmap_info_destroy); } *pix = info->pix; |