diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-09-30 15:43:08 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-09-30 15:43:08 +0000 |
commit | 9f3677418b8d406a939f507aa2f77fc4347e215b (patch) | |
tree | d2216e3c9061752720bce23047bbda5e7b6dc323 | |
parent | 9c4dd6ae2ddfaca30d2d00ab4de5b2f1c2cddaf0 (diff) | |
download | gdk-pixbuf-9f3677418b8d406a939f507aa2f77fc4347e215b.tar.gz |
Don't leak pixbuf in some cases. (#317611, Tommi Komulainen)
2005-09-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimage.c (gtk_image_expose): Don't leak pixbuf in
some cases. (#317611, Tommi Komulainen)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 3 | ||||
-rw-r--r-- | gtk/gtkimage.c | 30 |
3 files changed, 20 insertions, 16 deletions
@@ -1,5 +1,8 @@ 2005-09-30 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkimage.c (gtk_image_expose): Don't leak pixbuf in + some cases. (#317611, Tommi Komulainen) + * gtk/gtksocket-x11.c (_gtk_socket_windowing_size_request): Prevent overflow when storing size hints in an unsigned short variable. Tracked down by Ray Strode and Søren Sandmann. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 08cf0c74b..2d71e8dc5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2005-09-30 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkimage.c (gtk_image_expose): Don't leak pixbuf in + some cases. (#317611, Tommi Komulainen) + * gtk/gtksocket-x11.c (_gtk_socket_windowing_size_request): Prevent overflow when storing size hints in an unsigned short variable. Tracked down by Ray Strode and Søren Sandmann. diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 9fabd8e4d..0996db576 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1774,22 +1774,17 @@ gtk_image_expose (GtkWidget *widget, } if (pixbuf) - { - gdk_draw_pixbuf (widget->window, - widget->style->black_gc, - pixbuf, - image_bound.x - x, - image_bound.y - y, - image_bound.x, - image_bound.y, - image_bound.width, - image_bound.height, - GDK_RGB_DITHER_NORMAL, - 0, 0); - - g_object_unref (pixbuf); - pixbuf = NULL; - } + gdk_draw_pixbuf (widget->window, + widget->style->black_gc, + pixbuf, + image_bound.x - x, + image_bound.y - y, + image_bound.x, + image_bound.y, + image_bound.width, + image_bound.height, + GDK_RGB_DITHER_NORMAL, + 0, 0); } else { @@ -1830,6 +1825,9 @@ gtk_image_expose (GtkWidget *widget, gdk_gc_set_clip_mask (widget->style->black_gc, NULL); gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0); } + + if (pixbuf) + g_object_unref (pixbuf); } /* if widget is drawable */ |