diff options
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-ops.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 304eaab494..78f053da04 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ 2001-08-24 Peter Williams <peterw@ximian.com> + * mail-ops.c (remove_folder_get): Save the folder's full_name, unref it, + and *then* unref the store, so that the folder has been closed before + it gets deleted. + +2001-08-24 Peter Williams <peterw@ximian.com> + * mail-config.c (add_shortcut_entry): Instead of using the length of the shortcuts list as the index for the shortcut, use -1, which means "last". diff --git a/mail/mail-ops.c b/mail/mail-ops.c index be1a57bc4e..b3bfef3ec8 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1472,6 +1472,7 @@ remove_folder_get (struct _mail_msg *mm) CamelStore *store; CamelFolder *folder; GPtrArray *uids; + gchar *full_name; int i; m->removed = FALSE; @@ -1481,6 +1482,7 @@ remove_folder_get (struct _mail_msg *mm) store = camel_folder_get_parent_store (folder); if (!store) return; + camel_object_ref (CAMEL_OBJECT (store)); /* Delete every message in this folder, then expunge it */ uids = camel_folder_get_uids (folder); @@ -1489,8 +1491,13 @@ remove_folder_get (struct _mail_msg *mm) camel_folder_sync (folder, TRUE, &mm->ex); camel_folder_free_uids (folder, uids); + /* close the folder */ + full_name = g_strdup (camel_folder_get_full_name (folder)); + camel_object_unref (CAMEL_OBJECT (folder)); + /* Then delete the folder from the store */ - camel_store_delete_folder (store, camel_folder_get_full_name (folder), &mm->ex); + camel_store_delete_folder (store, full_name, &mm->ex); + g_free (full_name); m->removed = !camel_exception_is_set (&mm->ex); camel_object_unref (CAMEL_OBJECT (store)); |