diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-11-30 17:56:02 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-11-30 17:56:02 +0000 |
commit | bfa345c338f4e18e3c7c4bb9a4e04204a1dc5dc4 (patch) | |
tree | 79c779bf029914bf79e769e15c18335f7864565b /gdk/gdkpixbuf-render.c | |
parent | 1284c3fc425ff95cb79de4edb5b13a3374d572e2 (diff) | |
download | gtk+-bfa345c338f4e18e3c7c4bb9a4e04204a1dc5dc4.tar.gz |
Keep the mask around until after we draw ... since the GC changes aren't
1999-11-29 Owen Taylor <otaylor@redhat.com>
* src/gdk-pixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
Keep the mask around until after we draw ... since
the GC changes aren't flushed to the X server until we
draw, destroying it before that may result in BadPixmap
errors.
Diffstat (limited to 'gdk/gdkpixbuf-render.c')
-rw-r--r-- | gdk/gdkpixbuf-render.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 60ee06d29f..c85a367160 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -276,7 +276,7 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable, int x_dither, int y_dither) { ArtPixBuf *apb; - GdkBitmap *bitmap; + GdkBitmap *bitmap = NULL; GdkGC *gc; g_return_if_fail (pixbuf != NULL); @@ -306,7 +306,6 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable, gdk_gc_set_clip_mask (gc, bitmap); gdk_gc_set_clip_origin (gc, dest_x, dest_y); - gdk_bitmap_unref (bitmap); } gdk_pixbuf_render_to_drawable (pixbuf, drawable, gc, @@ -316,5 +315,8 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable, dither, x_dither, y_dither); + if (bitmap) + gdk_bitmap_unref (bitmap); gdk_gc_unref (gc); } + |