From: Josef 'Jeff' Sipek Date: Fri, 8 Nov 2019 17:58:47 +0000 (-0500) Subject: lib: Remove support for unregistering categories X-Git-Tag: 2.3.9~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e9a50c4b0d20c44c7e585c24c4e064fbd9f441e;p=thirdparty%2Fdovecot%2Fcore.git lib: Remove support for unregistering categories Nothing used the code and there were some unhandled corner cases. --- diff --git a/src/lib/lib-event.c b/src/lib/lib-event.c index 55af8176ae..218def6cdc 100644 --- a/src/lib/lib-event.c +++ b/src/lib/lib-event.c @@ -1098,37 +1098,6 @@ void event_category_unregister_callback(event_category_callback_t *callback) i_unreached(); } -static void event_category_remove_from_array(struct event_category *category) -{ - struct event_category *const *catp; - - array_foreach(&event_registered_categories, catp) { - if (*catp == category) { - array_delete(&event_registered_categories, - array_foreach_idx(&event_registered_categories, catp), 1); - return; - } - } - i_unreached(); -} - -void event_category_unregister(struct event_category *category) -{ - event_category_callback_t *const *callbackp; - - if (!category->registered) { - /* it was never registered in the first place - ignore */ - return; - } - - category->registered = FALSE; - event_category_remove_from_array(category); - - array_foreach(&event_category_callbacks, callbackp) T_BEGIN { - (*callbackp)(category); - } T_END; -} - static struct event_passthrough * event_passthrough_set_append_log_prefix(const char *prefix) { diff --git a/src/lib/lib-event.h b/src/lib/lib-event.h index 10445f1334..6bb86d0e4f 100644 --- a/src/lib/lib-event.h +++ b/src/lib/lib-event.h @@ -310,11 +310,6 @@ bool event_import_unescaped(struct event *event, const char *const *args, need to be called. */ void event_send_abort(struct event *event); -/* Explicitly register an event category. It must not be in use by any events - at this point. This is normally necessary only when unloading an plugin - that has registered an event category. */ -void event_category_unregister(struct event_category *category); - void lib_event_init(void); void lib_event_deinit(void);