changeset 5309:912213be8e8a HEAD

If new extension was introduced while we had already expunged some messages in the sync, we cleared existing expunge/sync extension contexts, which probably caused assert-crash.
author Timo Sirainen <tss@iki.fi>
date Wed, 14 Mar 2007 20:14:31 +0200
parents 7782f0be811d
children b02f3ec21baf
files src/lib-index/mail-index-sync-ext.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-ext.c	Wed Mar 14 18:49:14 2007 +0200
+++ b/src/lib-index/mail-index-sync-ext.c	Wed Mar 14 20:14:31 2007 +0200
@@ -85,13 +85,13 @@
 	count = array_count(&ctx->view->index->extensions);
 	i_assert(count > 0);
 
-	if (array_is_created(&ctx->extra_contexts))
-		array_clear(&ctx->extra_contexts);
-	else
+	if (!array_is_created(&ctx->extra_contexts))
 		i_array_init(&ctx->extra_contexts, count);
 
-	/* fill the context array with NULLs */
+	/* make sure the extra_contexts contains everything */
 	(void)array_idx_modifiable(&ctx->extra_contexts, count - 1);
+	/* we need to update the expunge handler list in case they had
+	   already been called */
 	ctx->expunge_handlers_set = FALSE;
 }