6bbc61
diff -up evolution-data-server-3.8.5/camel/camel-imapx-server.c.imapx-server-dispose-block evolution-data-server-3.8.5/camel/camel-imapx-server.c
6bbc61
--- evolution-data-server-3.8.5/camel/camel-imapx-server.c.imapx-server-dispose-block	2013-07-23 13:57:58.000000000 +0200
6bbc61
+++ evolution-data-server-3.8.5/camel/camel-imapx-server.c	2014-02-28 15:52:35.061106174 +0100
6bbc61
@@ -6978,13 +6978,8 @@ imapx_parser_thread (gpointer d)
6bbc61
 	is->parser_quit = FALSE;
6bbc61
 	g_signal_emit (is, signals[SHUTDOWN], 0);
9cfe9a
 
9cfe9a
-	return NULL;
9cfe9a
-}
9cfe9a
+	g_object_unref (is);
9cfe9a
 
9cfe9a
-static gpointer
9cfe9a
-join_helper (gpointer thread)
9cfe9a
-{
9cfe9a
-	g_thread_join (thread);
9cfe9a
 	return NULL;
9cfe9a
 }
9cfe9a
 
6bbc61
@@ -7056,14 +7051,8 @@ imapx_server_dispose (GObject *object)
9cfe9a
 	}
9cfe9a
 	QUEUE_UNLOCK (server);
9cfe9a
 
9cfe9a
-	if (server->parser_thread) {
9cfe9a
-		if (server->parser_thread == g_thread_self ()) {
9cfe9a
-			GThread *thread;
9cfe9a
-
9cfe9a
-			thread = g_thread_new (NULL, join_helper, server->parser_thread);
9cfe9a
-			g_thread_unref (thread);
9cfe9a
-		} else
9cfe9a
-			g_thread_join (server->parser_thread);
9cfe9a
+	if (server->parser_thread != NULL) {
9cfe9a
+		g_thread_unref (server->parser_thread);
9cfe9a
 		server->parser_thread = NULL;
9cfe9a
 	}
9cfe9a
 
6bbc61
@@ -7332,7 +7321,8 @@ camel_imapx_server_connect (CamelIMAPXSe
9cfe9a
 	if (!imapx_reconnect (is, cancellable, error))
9cfe9a
 		return FALSE;
9cfe9a
 
9cfe9a
-	is->parser_thread = g_thread_new (NULL, (GThreadFunc) imapx_parser_thread, is);
9cfe9a
+	is->parser_thread = g_thread_new (
9cfe9a
+		NULL, (GThreadFunc) imapx_parser_thread, g_object_ref (is));
9cfe9a
 
9cfe9a
 	return TRUE;
9cfe9a
 }