]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
liblib: io_loop_context_remove_callbacks() now requires also callbacks.
authorTimo Sirainen <tss@iki.fi>
Wed, 24 Aug 2011 21:27:10 +0000 (00:27 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 24 Aug 2011 21:27:10 +0000 (00:27 +0300)
src/lib-storage/mail-storage-service.c
src/lib/ioloop.c
src/lib/ioloop.h

index 0112f898fad778d55dc972e4bd5e5615cb425839..ad4add7ee6802508584a9c66bfccda3c1078e4db 100644 (file)
@@ -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);
index f424ee2f44aef29b5dd2ed19938b6e131f1f0f26..3f96163413952a224315c16b88e1d9858da9e2a8 100644 (file)
@@ -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;
index 0fc2a74c664da50e36dc356ee47ece3886b725c8..94ea6242d9a4a1fb18c0c313b16e24272fa278e0 100644 (file)
@@ -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. */