These were running outside the regular ioloop data stack frames, so if the
callback used any data stack it kept increasing memory usage.
This fixes excessive memory usage with old_stats plugin when used with
long-running imap sessions. The memory got filled with UPDATE-SESSION
commands.
io_loop_context_ref(ctx);
array_foreach_modifiable(&ctx->callbacks, cb) {
i_assert(!cb->activated);
- if (cb->activate != NULL)
+ if (cb->activate != NULL) T_BEGIN {
cb->activate(cb->context);
+ } T_END;
cb->activated = TRUE;
}
}
/* we just added this callback. don't deactivate it
before it gets first activated. */
} else {
- if (cb->deactivate != NULL)
+ if (cb->deactivate != NULL) T_BEGIN {
cb->deactivate(cb->context);
+ } T_END;
cb->activated = FALSE;
}
}