aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 3b81d62d6a..231b22ad95 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -209,7 +209,8 @@ filter_folder_free(struct _mail_msg *mm)
camel_operation_unref(m->cancel);
if (m->destination)
camel_object_unref((CamelObject *)m->destination);
- camel_object_unref((CamelObject *)m->driver);
+ if (m->driver)
+ camel_object_unref((CamelObject *)m->driver);
}
static struct _mail_msg_op filter_folder_op = {
@@ -333,6 +334,11 @@ fetch_mail_fetched(struct _mail_msg *mm)
{
struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm;
+ /* we unref this here as it may have more work to do (syncing
+ folders and whatnot) before we are really done */
+ camel_object_unref((CamelObject *)m->fmsg.driver);
+ m->fmsg.driver = NULL;
+
if (m->done)
m->done(m->source_uri, m->data);
}