[evolution] Bug 745013 - handle_http_request: GBinding not thread safe



commit 36776bab4add8943d65b1ad308ee891afbd8c18a
Author: Milan Crha <mcrha redhat com>
Date:   Tue Feb 24 08:39:10 2015 +0100

    Bug 745013 - handle_http_request: GBinding not thread safe

 mail/e-http-request.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index afe09cf..e374a77 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -360,6 +360,7 @@ handle_http_request (GSimpleAsyncResult *res,
                GIOStream *cache_stream;
                GError *error;
                GMainContext *context;
+               GProxyResolver *proxy_resolver = NULL;
 
                message = soup_message_new (SOUP_METHOD_GET, uri);
                if (!message) {
@@ -373,10 +374,11 @@ handle_http_request (GSimpleAsyncResult *res,
                temp_session = soup_session_new_with_options (
                        SOUP_SESSION_TIMEOUT, 90, NULL);
 
-               g_object_bind_property (
-                       soup_session, "proxy-resolver",
-                       temp_session, "proxy-resolver",
-                       G_BINDING_SYNC_CREATE);
+               /* Do not use g_object_bind_property() here, because it's not thread safe and
+                  this one-time setting may be sufficient too. */
+               g_object_get (soup_session, "proxy-resolver", &proxy_resolver, NULL);
+               g_object_set (temp_session, "proxy-resolver", proxy_resolver, NULL);
+               g_clear_object (&proxy_resolver);
 
                soup_message_headers_append (
                        message->request_headers,


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