dovecot-2.2: lib-storage: Fully unreference indexes when deletin...

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 25 03:21:20 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/5c15c7f57253
changeset: 18009:5c15c7f57253
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Oct 25 06:16:47 2014 +0300
description:
lib-storage: Fully unreference indexes when deleting mailboxes.

diffstat:

 src/lib-storage/index/index-storage.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 1886e0616ab5 -r 5c15c7f57253 src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c	Sat Oct 25 02:56:42 2014 +0300
+++ b/src/lib-storage/index/index-storage.c	Sat Oct 25 06:16:47 2014 +0300
@@ -377,7 +377,7 @@
 	ibox->sync_last_check = 0;
 }
 
-void index_storage_mailbox_free(struct mailbox *box)
+static void index_storage_mailbox_unref_indexes(struct mailbox *box)
 {
 	if (box->index_pvt != NULL)
 		mail_index_alloc_cache_unref(&box->index_pvt);
@@ -385,6 +385,11 @@
 		mail_index_alloc_cache_unref(&box->index);
 }
 
+void index_storage_mailbox_free(struct mailbox *box)
+{
+	index_storage_mailbox_unref_indexes(box);
+}
+
 static void
 index_storage_mailbox_update_cache(struct mailbox *box,
 				   const struct mailbox_update *update)
@@ -730,6 +735,7 @@
 	   implementations if indexes are opened by another session, but
 	   that can't really be helped. */
 	mailbox_close(box);
+	index_storage_mailbox_unref_indexes(box);
 	mail_index_alloc_cache_destroy_unrefed();
 
 	if (box->list->v.delete_mailbox(box->list, box->name) < 0) {


More information about the dovecot-cvs mailing list