dsync creates two mail_users and they're deinited at the same time.
stats_global_user isn't set after the first one is deinited, so the next
deinit crashed because it wasn't set.
Fixes:
Panic: file stats-plugin.c: line 324 (stats_user_deinit): assertion failed:
(stats_global_user == user)
struct stats_connection *stats_conn = suser->stats_conn;
i_assert(stats_user_count > 0);
- if (--stats_user_count == 0) {
+
+ stats_user_count--;
+ if (stats_global_user != NULL) {
/* we were updating the session lazily. do one final update. */
i_assert(stats_global_user == user);
stats_add_session(user);
stats_global_user = NULL;
- } else {
- i_assert(stats_global_user == NULL);
}
io_loop_context_remove_callbacks(suser->ioloop_ctx,