From: Timo Sirainen Date: Wed, 24 Aug 2011 21:27:10 +0000 (+0300) Subject: liblib: io_loop_context_remove_callbacks() now requires also callbacks. X-Git-Tag: 2.1.alpha1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae800c8a965688ab17415397dbc759a429e78199;p=thirdparty%2Fdovecot%2Fcore.git liblib: io_loop_context_remove_callbacks() now requires also callbacks. --- diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 0112f898fa..ad4add7ee6 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -1075,7 +1075,9 @@ void mail_storage_service_user_free(struct mail_storage_service_user **_user) *_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); diff --git a/src/lib/ioloop.c b/src/lib/ioloop.c index f424ee2f44..3f96163413 100644 --- a/src/lib/ioloop.c +++ b/src/lib/ioloop.c @@ -539,12 +539,14 @@ void io_loop_context_add_callbacks(struct ioloop_context *ctx, } 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; diff --git a/src/lib/ioloop.h b/src/lib/ioloop.h index 0fc2a74c66..94ea6242d9 100644 --- a/src/lib/ioloop.h +++ b/src/lib/ioloop.h @@ -112,9 +112,10 @@ void io_loop_context_unref(struct ioloop_context **ctx); 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. */