]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: dict - Keep track of next commit in dict_wait
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 11 Sep 2020 05:22:11 +0000 (08:22 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 11 Sep 2020 09:42:07 +0000 (12:42 +0300)
Satisfies static analyser, broken in
178bb676ea1dd380789d3587bf5e64fd85a29d7a

src/lib-dict/dict.c

index 1ed115151c5c38429a7d1cb80396fa47abf6d78c..ed2b8a406a2e6c03a3b4bf8a6b59932313d87a71 100644 (file)
@@ -165,11 +165,15 @@ void dict_deinit(struct dict **_dict)
 
 void dict_wait(struct dict *dict)
 {
+       struct dict_commit_callback_ctx *commit, *next;
+
        e_debug(dict->event, "Waiting for dict to finish pending operations");
        if (dict->v.wait != NULL)
                dict->v.wait(dict);
-       while (dict->commits != NULL)
-               dict_commit_async_timeout(dict->commits);
+       for (commit = dict->commits; commit != NULL; commit = next) {
+               next = commit->next;
+               dict_commit_async_timeout(commit);
+       }
 }
 
 bool dict_switch_ioloop(struct dict *dict)