diff options
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 060e0aab5..2a4b86781 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -566,6 +566,21 @@ pixbuf_avatar_from_individual_closure_free ( } static void +avatar_icon_load_close_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + + g_input_stream_close_finish (G_INPUT_STREAM (object), result, &error); + + if (error != NULL) { + DEBUG ("Failed to close pixbuf stream: %s", error->message); + g_error_free (error); + } +} + +static void avatar_icon_load_read_cb (GObject *object, GAsyncResult *result, gpointer user_data) @@ -607,6 +622,11 @@ 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. */ |