changeset 7458:43674a726a92 HEAD

If mailbox hasn't been opened when closing it, don't crash when trying to flush dirty flags.
author Timo Sirainen <tss@iki.fi>
date Thu, 24 Apr 2008 17:03:10 +0300
parents 940641318f12
children 63cd8ec2007a
files src/lib-storage/index/dbox/dbox-storage.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c	Thu Apr 24 16:59:19 2008 +0300
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Thu Apr 24 17:03:10 2008 +0300
@@ -308,7 +308,10 @@
 	struct dbox_mailbox *mbox = (struct dbox_mailbox *)box;
 	int ret;
 
-	ret = dbox_sync(mbox, TRUE);
+	if (box->opened) {
+		/* see if we want to flush dirty flags */
+		ret = dbox_sync(mbox, TRUE);
+	}
 
 	dbox_index_deinit(&mbox->dbox_index);
 	dbox_files_free(mbox);