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



commit bdfd06ef36a21542436e3a2967dc9bb52410f6c1
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 54bc73d..d655cd8 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -721,9 +721,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;
@@ -820,6 +817,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]