aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-threads.c')
-rw-r--r--mail/mail-threads.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mail/mail-threads.c b/mail/mail-threads.c
index 4b989bb762..8f0e263765 100644
--- a/mail/mail-threads.c
+++ b/mail/mail-threads.c
@@ -557,9 +557,14 @@ mail_operations_terminate (void)
memset (&clur, 0, sizeof (closure_t));
clur.spec = NULL;
- pipe_write (DISPATCH_WRITER, &clur, sizeof (closure_t));
+ /* DISPATCH_WRITER will only have been initialized if any
+ * calls have been made using the old thread system.
+ */
+ if (DISPATCH_WRITER != -1) {
+ pipe_write (DISPATCH_WRITER, &clur, sizeof (closure_t));
- close (DISPATCH_WRITER);
+ close (DISPATCH_WRITER);
+ }
close (MAIN_READER);
}