changeset 2314:e2714bd499b7 HEAD

fetch_mail needs to be deinitialized before transaction is committed or rollbacked
author Timo Sirainen <tss@iki.fi>
date Sat, 10 Jul 2004 14:15:42 +0300
parents affe191f21ed
children 22210d6cf238
files src/lib-storage/index/index-transaction.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-transaction.c	Sat Jul 10 14:14:58 2004 +0300
+++ b/src/lib-storage/index/index-transaction.c	Sat Jul 10 14:15:42 2004 +0300
@@ -19,9 +19,6 @@
 	mail_cache_view_close(t->cache_view);
 	mail_index_view_close(t->trans_view);
 	mail_index_view_unlock(t->ibox->view);
-
-	if (t->fetch_mail.pool != NULL)
-		index_mail_deinit(&t->fetch_mail);
 	i_free(t);
 }
 
@@ -33,6 +30,9 @@
 	uoff_t offset;
 	int ret;
 
+	if (t->fetch_mail.pool != NULL)
+		index_mail_deinit(&t->fetch_mail);
+
 	ret = mail_index_transaction_commit(t->trans, &seq, &offset);
 	if (ret < 0)
 		mail_storage_set_index_error(t->ibox);
@@ -51,6 +51,9 @@
 	struct index_transaction_context *t =
 		(struct index_transaction_context *)_t;
 
+	if (t->fetch_mail.pool != NULL)
+		index_mail_deinit(&t->fetch_mail);
+
 	mail_index_transaction_rollback(t->trans);
 	index_transaction_free(t);
 }