]> git.0d.be Git - empathy.git/commitdiff
Don't leak FDs when loading avatars.
authorWill Thompson <will.thompson@collabora.co.uk>
Fri, 26 Aug 2011 12:48:57 +0000 (13:48 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Fri, 26 Aug 2011 13:12:07 +0000 (14:12 +0100)
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
libempathy-gtk/empathy-ui-utils.c

index 2a4b867815c1c04f949c7a7a6771e7606499551f..d5f63c9e0281271dd3b2a7908603aa5cf2c40c5c 100644 (file)
@@ -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);