From 39e8ec3c3dc534bb1f3fffcdcf4c952d12b7bce9 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 24 Aug 2001 19:10:22 +0000 Subject: Save the folder's full_name, unref it, and *then* unref the store, so that 2001-08-24 Peter Williams * 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 --- mail/ChangeLog | 6 ++++++ mail/mail-ops.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 304eaab494..78f053da04 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-08-24 Peter Williams + + * 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 * mail-config.c (add_shortcut_entry): Instead of using the length 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)); -- cgit v1.2.3