From d244e01c6d19df90efb20ee4dcf15972f0e10cbc Mon Sep 17 00:00:00 2001 From: 0 Date: Tue, 30 Oct 2001 18:52:18 +0000 Subject: If we have a cancellation setup, destroy it immediately, to save fd's. 2001-10-30 * mail-mt.c (mail_msg_received): If we have a cancellation setup, destroy it immediately, to save fd's. (mail_msg_cancel): Check cancel != NULL. (mail_msg_free): Same. svn path=/trunk/; revision=14470 --- mail/ChangeLog | 5 +++++ mail/mail-mt.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index b9b5c81186..b6af992250 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2001-10-30 + * mail-mt.c (mail_msg_received): If we have a cancellation setup, + destroy it immediately, to save fd's. + (mail_msg_cancel): Check cancel != NULL. + (mail_msg_free): Same. + * folder-info.c: Comment out the Folder: and you've got mail prints. diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 25ff6c632a..d02eaaab60 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -206,7 +206,9 @@ void mail_msg_free(void *msg) MAIL_MT_UNLOCK(mail_msg_lock); - camel_operation_unref(m->cancel); + if (m->cancel) + camel_operation_unref(m->cancel); + camel_exception_clear(&m->ex); /*g_free(m->priv->what);*/ g_free(m->priv); @@ -277,7 +279,7 @@ void mail_msg_cancel(unsigned int msgid) MAIL_MT_LOCK(mail_msg_lock); m = g_hash_table_lookup(mail_msg_active_table, (void *)msgid); - if (m) + if (m && m->cancel) camel_operation_cancel(m->cancel); MAIL_MT_UNLOCK(mail_msg_lock); @@ -500,6 +502,10 @@ mail_msg_received(EThread *e, EMsg *msg, void *data) if (m->ops->describe_msg) { camel_operation_end(m->cancel); camel_operation_unregister(m->cancel); + MAIL_MT_LOCK(mail_msg_lock); + camel_operation_unref(m->cancel); + m->cancel = NULL; + MAIL_MT_UNLOCK(mail_msg_lock); } } @@ -909,7 +915,8 @@ static void do_op_status(struct _mail_msg *mm) MAIL_MT_UNLOCK (mail_msg_lock); if (activity) gtk_object_unref (GTK_OBJECT (activity)); - camel_operation_unref (msg->cancel); + if (msg->cancel) + camel_operation_unref (msg->cancel); camel_exception_clear (&msg->ex); g_free (msg->priv); g_free (msg); -- cgit