[gdk-pixbuf] Plug a memory leak when using GBytes
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] Plug a memory leak when using GBytes
- Date: Wed, 25 Apr 2018 14:55:30 +0000 (UTC)
commit a17ef43a3c25e09d33a686ba3575667eaf084760
Author: Vitaly Kirsanov <krokoziabla gmail com>
Date: Wed Sep 13 13:07:00 2017 +0000
Plug a memory leak when using GBytes
Calling g_bytes_unref_to_data() will copy the contents of the bytes
buffer, so we need to free the data.
https://bugzilla.gnome.org/show_bug.cgi?id=787626
gdk-pixbuf/gdk-pixbuf.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index a0454c3..c86d096 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -715,6 +715,8 @@ gdk_pixbuf_get_pixels_with_length (const GdkPixbuf *pixbuf,
gsize len;
mut_pixbuf->pixels = g_bytes_unref_to_data (pixbuf->bytes, &len);
mut_pixbuf->bytes = NULL;
+ mut_pixbuf->destroy_fn = free_buffer;
+ mut_pixbuf->destroy_fn_data = NULL;
}
if (length)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]