[evolution-data-server] CamelIMAPXServer: Work around crash in imapx_exit_idle().



commit e306c4508b277492c8ddf4e6abf4ba13f6f31215
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Nov 9 06:29:21 2012 -0500

    CamelIMAPXServer: Work around crash in imapx_exit_idle().
    
    g_cond_clear() doesn't like being given an uninitialized GCond.
    
    The "start_watch_cond" and "start_watch_exit" structures are being
    cleared unconditionally, so we should initialize them unconditionally.

 camel/camel-imapx-server.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index a265838..fa993ca 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -2958,6 +2958,9 @@ imapx_init_idle (CamelIMAPXServer *is)
 {
 	is->idle = g_new0 (CamelIMAPXIdle, 1);
 	g_mutex_init (&is->idle->idle_lock);
+
+	g_cond_init (&is->idle->start_watch_cond);
+	g_mutex_init (&is->idle->start_watch_mutex);
 }
 
 static void
@@ -3012,8 +3015,6 @@ imapx_start_idle (CamelIMAPXServer *is)
 	idle->state = IMAPX_IDLE_PENDING;
 
 	if (!idle->idle_thread) {
-		g_cond_init (&idle->start_watch_cond);
-		g_mutex_init (&idle->start_watch_mutex);
 		idle->start_watch_is_set = FALSE;
 
 		idle->idle_thread = g_thread_new (NULL,



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