diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-07-09 06:59:23 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-07-09 06:59:23 +0800 |
commit | a2ab50c057cbe9baafa63372767c5022901838f6 (patch) | |
tree | c91c81252034914677e56926357cc95627ce538b /mail/mail-ops.c | |
parent | 82c99d625bf2d763adf0b812dd59b92a4aaa4735 (diff) | |
download | gsoc2013-evolution-a2ab50c057cbe9baafa63372767c5022901838f6.tar.gz gsoc2013-evolution-a2ab50c057cbe9baafa63372767c5022901838f6.tar.zst gsoc2013-evolution-a2ab50c057cbe9baafa63372767c5022901838f6.zip |
Don't ever use the mail-display's current_message, this can cause
2002-07-08 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (redirect): Don't ever use the mail-display's
current_message, this can cause problems.
* mail-ops.c (get_message_free): Unref the gotten message. All of
the callers seemed to think that they didn't have to unref the
message.
* mail-display.c (mail_display_set_message): Now refs the message.
(mail_display_destroy): Unref the current_message if we still have
ownership of it.
svn path=/trunk/; revision=17387
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index c43d93a039..dd69f923a2 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -828,7 +828,7 @@ struct _append_msg { CamelMessageInfo *info; char *appended_uid; - void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, char *appended_uid, void *data); + void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, const char *appended_uid, void *data); void *data; }; @@ -1610,7 +1610,7 @@ struct _get_message_msg { CamelFolder *folder; char *uid; - void (*done) (CamelFolder *folder, char *uid, CamelMimeMessage *msg, void *data); + void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data); void *data; CamelMimeMessage *message; CamelOperation *cancel; @@ -1641,10 +1641,13 @@ static void get_message_got(struct _mail_msg *mm) static void get_message_free(struct _mail_msg *mm) { struct _get_message_msg *m = (struct _get_message_msg *)mm; - - g_free(m->uid); - camel_object_unref((CamelObject *)m->folder); - camel_operation_unref(m->cancel); + + g_free (m->uid); + camel_object_unref (m->folder); + camel_operation_unref (m->cancel); + + if (m->message) + camel_object_unref (m->message); } static struct _mail_msg_op get_message_op = { @@ -1655,10 +1658,12 @@ static struct _mail_msg_op get_message_op = { }; void -mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, char *uid, CamelMimeMessage *msg, void *data), void *data, EThread *thread) +mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid, + CamelMimeMessage *msg, void *data), + void *data, EThread *thread) { struct _get_message_msg *m; - + m = mail_msg_new(&get_message_op, NULL, sizeof(*m)); m->folder = folder; camel_object_ref((CamelObject *)folder); @@ -1666,7 +1671,7 @@ mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder m->data = data; m->done = done; m->cancel = camel_operation_new(NULL, NULL); - + e_thread_put(thread, (EMsg *)m); } |