aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-10-31 02:52:18 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-31 02:52:18 +0800
commitd244e01c6d19df90efb20ee4dcf15972f0e10cbc (patch)
treef83885690a05c0121f8b450c80a333d1780b280d
parent3afcc4239f9fde2ba8adbfa2ea6dcfc72509c846 (diff)
downloadgsoc2013-evolution-d244e01c6d19df90efb20ee4dcf15972f0e10cbc.tar.gz
gsoc2013-evolution-d244e01c6d19df90efb20ee4dcf15972f0e10cbc.tar.zst
gsoc2013-evolution-d244e01c6d19df90efb20ee4dcf15972f0e10cbc.zip
If we have a cancellation setup, destroy it immediately, to save fd's.
2001-10-30 <NotZed@Ximian.com> * 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
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-mt.c13
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 <NotZed@Ximian.com>
+ * 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);