From 77a825c69316fbe58dd01343845e9eab0e35a9a2 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 30 Jul 2013 12:32:15 +0200 Subject: Bug #705119 - File descriptors for images not closed --- mail/e-http-request.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mail') diff --git a/mail/e-http-request.c b/mail/e-http-request.c index fb516f98ba..a4a35567ed 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -379,16 +379,18 @@ handle_http_request (GSimpleAsyncResult *res, camel_stream_write ( cache_stream, message->response_body->data, message->response_body->length, cancellable, &error); + + camel_stream_close (cache_stream, cancellable, NULL); + g_object_unref (cache_stream); + if (error != NULL) { - g_warning ( - "Failed to write data to cache stream: %s", - error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ( + "Failed to write data to cache stream: %s", + error->message); g_clear_error (&error); goto cleanup; } - - camel_stream_close (cache_stream, cancellable, NULL); - g_object_unref (cache_stream); } /* Send the response body to WebKit */ -- cgit v1.2.3