From 1a9409a95f0eb40e4ec32bcad84ec3c2df62f58a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 24 May 2001 03:31:24 +0000 Subject: Don't free the folder-info here, instead have mail_append_mail() call our 2001-05-23 Jeffrey Stedfast * mail-callbacks.c (composer_postpone_cb): Don't free the folder-info here, instead have mail_append_mail() call our new function, append_mail_cleanup() which'll free the folder-info. This fixes the problem of send-later segfaulting. svn path=/trunk/; revision=9958 --- mail/ChangeLog | 5 +++++ mail/mail-callbacks.c | 9 +++++++-- mail/mail-ops.c | 19 ++++++++++--------- 3 files changed, 22 insertions(+), 11 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index a0fffd755d..eb394c2aa3 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2001-05-23 Jeffrey Stedfast + * mail-callbacks.c (composer_postpone_cb): Don't free the + folder-info here, instead have mail_append_mail() call our new + function, append_mail_cleanup() which'll free the + folder-info. This fixes the problem of send-later segfaulting. + * message-list.c (message_list_set_folder): Make the message-list respect the "hide deleted messages" setting. Fixes bug #2248. diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 778dc5f043..38734b37cf 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -368,6 +368,12 @@ composer_send_cb (EMsgComposer *composer, gpointer data) mail_send_mail (transport->url, message, composer_sent_cb, send); } +static void +append_mail_cleanup (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, void *data) +{ + camel_message_info_free (info); +} + void composer_postpone_cb (EMsgComposer *composer, gpointer data) { @@ -382,9 +388,8 @@ composer_postpone_cb (EMsgComposer *composer, gpointer data) info = camel_message_info_new (); info->flags = CAMEL_MESSAGE_SEEN; - mail_append_mail (outbox_folder, message, info, NULL, NULL); + mail_append_mail (outbox_folder, message, info, append_mail_cleanup, NULL); camel_object_unref (CAMEL_OBJECT (message)); - camel_message_info_free (info); if (psd) { camel_folder_set_message_flags (psd->folder, psd->uid, psd->flags, psd->flags); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 4b99bc76ac..34a88a7b51 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -860,24 +860,25 @@ void mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info, - void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, void *data), void *data) + void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, void *data), + void *data) { struct _append_msg *m; - + g_return_if_fail (CAMEL_IS_FOLDER (folder)); g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); - - m = mail_msg_new(&append_mail_op, NULL, sizeof(*m)); + + m = mail_msg_new (&append_mail_op, NULL, sizeof (*m)); m->folder = folder; - camel_object_ref((CamelObject *)folder); + camel_object_ref (CAMEL_OBJECT (folder)); m->message = message; - camel_object_ref((CamelObject *)message); + camel_object_ref (CAMEL_OBJECT (message)); m->info = info; - + m->done = done; m->data = data; - - e_thread_put(mail_thread_new, (EMsg *)m); + + e_thread_put (mail_thread_new, (EMsg *)m); } /* ** TRANSFER MESSAGES **************************************************** */ -- cgit v1.2.3