changeset 5997:e047e5b19fbd HEAD

mail_index_ext_reset() and mail_index_ext_set_reset_id() need to clear ext header updates and resizes. mail_index_ext_set_reset_id() also needs to clear ext resets.
author Timo Sirainen <tss@iki.fi>
date Sun, 15 Jul 2007 00:37:57 +0300
parents 00be53d8f076
children 7a632ae07cea
files src/lib-index/mail-index-transaction.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-transaction.c	Sun Jul 15 00:28:08 2007 +0300
+++ b/src/lib-index/mail-index-transaction.c	Sun Jul 15 00:37:57 2007 +0300
@@ -868,6 +868,25 @@
 		if (array_is_created(array))
 			array_clear(array);
 	}
+	if (array_is_created(&t->ext_hdr_updates) &&
+	    ext_id < array_count(&t->ext_hdr_updates)) {
+		/* if extension headers have been updated, clear them */
+		struct mail_index_transaction_ext_hdr_update **hdr;
+
+		hdr = array_idx_modifiable(&t->ext_hdr_updates, ext_id);
+		if (*hdr != NULL)
+			i_free_and_null(*hdr);
+	}
+	if (array_is_created(&t->ext_resets) &&
+	    ext_id < array_count(&t->ext_resets)) {
+		/* clear resets */
+		array_idx_clear(&t->ext_resets, ext_id);
+	}
+	if (array_is_created(&t->ext_resizes) &&
+	    ext_id < array_count(&t->ext_resizes)) {
+		/* clear resizes */
+		array_idx_clear(&t->ext_resets, ext_id);
+	}
 
 	if (!array_is_created(&t->ext_reset_ids))
 		i_array_init(&t->ext_reset_ids, ext_id + 2);