diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2004-08-24 14:44:43 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-08-24 14:44:43 +0000 |
commit | fabf8664f8e4d87967d8aec71b0a3045a232ad88 (patch) | |
tree | a4571e8971afbf18153a4059fd53ae7a95e6aa96 | |
parent | b97018ad7fc6d484877a2f9dec0adf47620fd0b0 (diff) | |
download | gdk-pixbuf-fabf8664f8e4d87967d8aec71b0a3045a232ad88.tar.gz |
Actually free the temporary pixbuf data.
-rw-r--r-- | gdk-pixbuf/gdk-pixdata.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gdk-pixbuf/gdk-pixdata.c b/gdk-pixbuf/gdk-pixdata.c index e027ed659..cfe81fa38 100644 --- a/gdk-pixbuf/gdk-pixdata.c +++ b/gdk-pixbuf/gdk-pixdata.c @@ -290,6 +290,13 @@ rl_encode_rgbx (guint8 *bp, /* dest buffer */ return bp; } +/* Used as the destroy notification function for gdk_pixbuf_new() */ +static void +free_buffer (guchar *pixels, gpointer data) +{ + g_free (pixels); +} + /** * gdk_pixdata_from_pixbuf: * @pixdata: a #GdkPixdata to fill. @@ -341,12 +348,12 @@ gdk_pixdata_from_pixbuf (GdkPixdata *pixdata, pixbuf->width, pixbuf->height, rowstride, - NULL, NULL); + free_buffer, NULL); gdk_pixbuf_copy_area (pixbuf, 0, 0, pixbuf->width, pixbuf->height, buf, 0, 0); } else - buf = pixbuf; + buf = (GdkPixbuf *)pixbuf; pad = rowstride; pad = MAX (pad, 130 + n_bytes / 127); data = g_new (guint8, pad + n_bytes); |