From e306c4508b277492c8ddf4e6abf4ba13f6f31215 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 9 Nov 2012 06:29:21 -0500 Subject: [PATCH] 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 file 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, -- 2.7.4