[evolution] Bug #705119 - File descriptors for images not closed



commit 77a825c69316fbe58dd01343845e9eab0e35a9a2
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jul 30 12:32:15 2013 +0200

    Bug #705119 - File descriptors for images not closed

 mail/e-http-request.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index fb516f9..a4a3556 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]