aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-08-25 03:10:22 +0800
committerPeter Williams <peterw@src.gnome.org>2001-08-25 03:10:22 +0800
commit39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9 (patch)
tree902594d37611cf90968d9a48097369df82a1467c
parent2fba11c88fa90dc7b34a1b191ca327f942c47150 (diff)
downloadgsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar
gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.gz
gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.bz2
gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.lz
gsoc2013-evolution-39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9.tar.xz
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
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-ops.c9
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));