]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Changed mail_cache_view_close() API to take pointer-to-pointer.
authorTimo Sirainen <tss@iki.fi>
Wed, 31 Aug 2011 09:29:21 +0000 (12:29 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 31 Aug 2011 09:29:21 +0000 (12:29 +0300)
src/doveadm/doveadm-dump-index.c
src/lib-index/mail-cache-compress.c
src/lib-index/mail-cache.c
src/lib-index/mail-cache.h
src/lib-storage/index/index-status.c
src/lib-storage/index/index-transaction.c

index da697d90c9b074dfdefea4504991a9553a8d370c..d42a90d3598510784dd206ea2c4865e76fb58198 100644 (file)
@@ -579,7 +579,7 @@ static void cmd_dump_index(int argc ATTR_UNUSED, char *argv[])
                        } T_END;
                }
        }
-       mail_cache_view_close(cache_view);
+       mail_cache_view_close(&cache_view);
        mail_index_view_close(&view);
        mail_index_close(index);
        mail_index_free(&index);
index 28436209188db16cdd6db4b9248ed4c618811f6e..cb9b692916c48461b783b77685c998aaee2f62f1 100644 (file)
@@ -280,7 +280,7 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans,
        o_stream_seek(output, 0);
        o_stream_send(output, &hdr, sizeof(hdr));
 
-       mail_cache_view_close(cache_view);
+       mail_cache_view_close(&cache_view);
 
        if (o_stream_flush(output) < 0) {
                errno = output->stream_errno;
index 79d232f6ebc446df7acdde803358c5fcb6994485..f81db683bbe9c41afd9aca1b5d8448f00b5f05a7 100644 (file)
@@ -707,10 +707,13 @@ mail_cache_view_open(struct mail_cache *cache, struct mail_index_view *iview)
        return view;
 }
 
-void mail_cache_view_close(struct mail_cache_view *view)
+void mail_cache_view_close(struct mail_cache_view **_view)
 {
+       struct mail_cache_view *view = *_view;
+
        i_assert(view->trans_view == NULL);
 
+       *_view = NULL;
        if (view->cache->field_header_write_pending &&
            !view->cache->compressing)
                 (void)mail_cache_header_fields_update(view->cache);
index 824cf7dd004eaadb06abe768acb0b238bed546d0..846e526e3d1a21584c8cc543161fda494ba20a4b 100644 (file)
@@ -71,7 +71,7 @@ bool mail_cache_exists(struct mail_cache *cache);
 
 struct mail_cache_view *
 mail_cache_view_open(struct mail_cache *cache, struct mail_index_view *iview);
-void mail_cache_view_close(struct mail_cache_view *view);
+void mail_cache_view_close(struct mail_cache_view **view);
 
 /* Normally cache decisions are updated on lookup/add. Use this function to
    enable/disable this (useful for precaching data). */
index 4bfe873d65ed39ddfe4265076f33c6fe66c10057..54e671d07167ccb2e8384f5fef1ee173283d57d9 100644 (file)
@@ -26,7 +26,7 @@ get_last_cached_seq(struct mailbox *box, uint32_t *last_cached_seq_r)
                        break;
                }
        }
-       mail_cache_view_close(cache_view);
+       mail_cache_view_close(&cache_view);
 }
 
 int index_storage_get_status(struct mailbox *box,
index 2507d5687dfde7cc81087104872d997c4f9db769..b92a82b2782edb498a21266c865d028e5fd551c2 100644 (file)
@@ -7,7 +7,7 @@
 
 static void index_transaction_free(struct mailbox_transaction_context *t)
 {
-       mail_cache_view_close(t->cache_view);
+       mail_cache_view_close(&t->cache_view);
        mail_index_view_close(&t->view);
        array_free(&t->module_contexts);
        i_free(t);