[evolution-ews] Bug 665801 - Crash in SoupSessionAsync::finalize



commit 253c2a7f49bec19e8c7be81b0ef1a68064b70c65
Author: David Woodhouse <David Woodhouse intel com>
Date:   Wed Feb 8 14:35:49 2012 +0000

    Bug 665801 - Crash in SoupSessionAsync::finalize
    
    Gr, I hate the way that libsoup can't cope with being called from anything
    but its *own* context. Unless you are prepared to use synchronous operations,
    it seems to have absolutely no locking of its own :(
    
    Work around this by even calling g_object_unref() for the SoupSession from
    its own thread/context.

 src/server/e-ews-connection.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 9d640d3..e3eb4ef 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -720,9 +720,6 @@ e_ews_connection_dispose (GObject *object)
 	g_signal_handlers_disconnect_by_func	(priv->soup_session, ews_connection_authenticate, cnc);
 
 	if (priv->soup_session) {
-		g_object_unref (priv->soup_session);
-		priv->soup_session = NULL;
-
 		g_main_loop_quit(priv->soup_loop);
 		g_thread_join(priv->soup_thread);
 		priv->soup_thread = NULL;
@@ -819,6 +816,10 @@ static gpointer e_ews_soup_thread (gpointer user_data)
 	g_main_context_push_thread_default (priv->soup_context);
 	g_main_loop_run (priv->soup_loop);
 	g_main_context_pop_thread_default (priv->soup_context);
+
+	g_object_unref (priv->soup_session);
+	priv->soup_session = NULL;
+
 	return NULL;
 }
 



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