summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2007-01-17 04:24:00 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-01-17 04:24:00 +0000
commit5a119668b1b0d119bf3ff54c989cce3c74144370 (patch)
treef1c32835e7f688795cf9a86e2b20501a9a15a9e3 /gdk-pixbuf
parent18cc703fa45a65c3a541953d691b467f4d5d8c4e (diff)
downloadgdk-pixbuf-5a119668b1b0d119bf3ff54c989cce3c74144370.tar.gz
Fix memory leaks in error paths
svn path=/trunk/; revision=17165
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog7
-rw-r--r--gdk-pixbuf/gdk-pixbuf-loader.c11
2 files changed, 8 insertions, 10 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 043da1d8c..9f617d1cd 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-16 Matthias Clasen <mclasen@redhat.com>
+
+ * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Just
+ call gdk_pixbuf_loader_close to close the loader in
+ the error case. Fixes memory leaks in the error case,
+ pointed out by David Necas.
+
2007-01-04 Matthias Clasen <mclasen@redhat.com>
* io-bmp.c (OneLine32): Fix a warning
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c
index 6ee5837f6..c8c985229 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.c
+++ b/gdk-pixbuf/gdk-pixbuf-loader.c
@@ -472,16 +472,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
fail:
gdk_pixbuf_loader_ensure_error (loader, error);
-
- priv->closed = TRUE;
-
- if (priv->image_module && priv->holds_threadlock)
- {
- _gdk_pixbuf_unlock (priv->image_module);
- priv->holds_threadlock = FALSE;
- }
-
- g_signal_emit (loader, pixbuf_loader_signals[CLOSED], 0);
+ gdk_pixbuf_loader_close (loader, NULL);
return FALSE;
}