[evolution-ews/gnome-3-2] Bug 665801 - Crash in SoupSessionAsync::finalize



commit 8509aaf0ffaae980564b4e31ff2979db4ee81320
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.
    (cherry picked from commit 253c2a7f49bec19e8c7be81b0ef1a68064b70c65)

 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 767f071..29aad61 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -696,9 +696,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;
@@ -795,6 +792,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]