diff options
author | Peter Williams <peterw@ximian.com> | 2001-08-25 03:10:22 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-08-25 03:10:22 +0800 |
commit | 39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9 (patch) | |
tree | 902594d37611cf90968d9a48097369df82a1467c /mail/mail-ops.c | |
parent | 2fba11c88fa90dc7b34a1b191ca327f942c47150 (diff) | |
download | gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.gz gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.zst gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.zip |
Save the folder's full_name, unref it, and *then* unref the store, so that
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.
svn path=/trunk/; revision=12446
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
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)); |