*_user = NULL;
if (user->ioloop_ctx != NULL) {
- io_loop_context_remove_callbacks(user->ioloop_ctx, user);
+ io_loop_context_remove_callbacks(user->ioloop_ctx,
+ mail_storage_service_io_activate,
+ mail_storage_service_io_deactivate, user);
io_loop_context_unref(&user->ioloop_ctx);
}
settings_parser_deinit(&user->set_parser);
}
void io_loop_context_remove_callbacks(struct ioloop_context *ctx,
- void *context)
+ io_callback_t *activate,
+ io_callback_t *deactivate, void *context)
{
struct ioloop_context_callback *cb;
array_foreach_modifiable(&ctx->callbacks, cb) {
- if (cb->context == context) {
+ if (cb->context == context &&
+ cb->activate == activate && cb->deactivate == deactivate) {
/* simply mark it as deleted, since we could get
here from activate/deactivate loop */
cb->activate = NULL;
void io_loop_context_add_callbacks(struct ioloop_context *ctx,
io_callback_t *activate,
io_callback_t *deactivate, void *context);
-/* Remove callbacks with the given context. */
+/* Remove callbacks with the given callbacks and context. */
void io_loop_context_remove_callbacks(struct ioloop_context *ctx,
- void *context);
+ io_callback_t *activate,
+ io_callback_t *deactivate, void *context);
/* Move the given I/O into the current I/O loop if it's not already
there. New I/O is returned, while the old one is freed. */