summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2004-08-24 14:44:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-08-24 14:44:43 +0000
commitfabf8664f8e4d87967d8aec71b0a3045a232ad88 (patch)
treea4571e8971afbf18153a4059fd53ae7a95e6aa96
parentb97018ad7fc6d484877a2f9dec0adf47620fd0b0 (diff)
downloadgdk-pixbuf-fabf8664f8e4d87967d8aec71b0a3045a232ad88.tar.gz
Actually free the temporary pixbuf data.
-rw-r--r--gdk-pixbuf/gdk-pixdata.c11
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);