aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-08-26 20:48:57 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2011-08-26 21:12:07 +0800
commit3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b (patch)
tree6c3235f56c1a566658579664fa965d42c175c764 /libempathy-gtk
parent7bae092e57e57103fa543d66c0bb11ac3ba4d43d (diff)
downloadgsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar.gz
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar.bz2
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar.lz
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar.xz
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.tar.zst
gsoc2013-empathy-3000a3d49b6f0f8e1f2e364a780b75f01e0d8e6b.zip
Don't leak FDs when loading avatars.
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 2a4b86781..d5f63c9e0 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -622,11 +622,6 @@ avatar_icon_load_read_cb (GObject *object,
avatar_pixbuf_from_loader (closure->loader),
g_object_unref);
- /* Close the file for safety (even though it should be
- * automatically closed when the stream is finalised). */
- g_input_stream_close_async (stream, G_PRIORITY_DEFAULT, NULL,
- (GAsyncReadyCallback) avatar_icon_load_close_cb, NULL);
-
goto out;
} else {
/* Loop round and read another chunk. */
@@ -643,6 +638,11 @@ out_close:
gdk_pixbuf_loader_close (closure->loader, NULL);
out:
+ /* Close the file for safety (even though it should be
+ * automatically closed when the stream is finalised). */
+ g_input_stream_close_async (stream, G_PRIORITY_DEFAULT, NULL,
+ (GAsyncReadyCallback) avatar_icon_load_close_cb, NULL);
+
g_simple_async_result_complete (closure->result);
g_clear_error (&error);