From d8e8d0fd5040f666121503665914774b34489ed0 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 25 Feb 2005 03:39:12 +0000 Subject: ** See bug #71003 2005-02-21 Not Zed ** See bug #71003 * mail-component.c (impl_quit): add a new state MC_QUIT_THREADS to wait for all mail threads to finish before quitting. svn path=/trunk/; revision=28884 --- mail/ChangeLog | 7 +++++++ mail/mail-component.c | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 1b961d0c82..10d252b167 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2005-02-21 Not Zed + + ** See bug #71003 + + * mail-component.c (impl_quit): add a new state MC_QUIT_THREADS to + wait for all mail threads to finish before quitting. + 2005-02-23 Jeffrey Stedfast * em-format-html.c (efh_format_header): Don't use the pre-UTF-8 diff --git a/mail/mail-component.c b/mail/mail-component.c index bd322ebf18..817d23114f 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -111,7 +111,7 @@ struct _MailComponentPrivate { GMutex *lock; /* states/data used during shutdown */ - enum { MC_QUIT_START, MC_QUIT_SYNC } quit_state; + enum { MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state; int quit_count; int quit_expunge; /* expunge on quit this time around? */ @@ -692,8 +692,16 @@ impl_quit(PortableServer_Servant servant, CORBA_Environment *ev) } /* Falls through */ case MC_QUIT_SYNC: - return mc->priv->quit_count == 0; - /* What else do we need to do at quit time? */ + if (mc->priv->quit_count > 0) + return TRUE; + + mail_cancel_all(); + mc->priv->quit_state = MC_QUIT_THREADS; + + /* Falls through */ + case MC_QUIT_THREADS: + /* should we keep cancelling? */ + return mail_msg_active((unsigned int)-1) == 0; } return TRUE; -- cgit v1.2.3