From 4759350b9a020d735506479e2d51c76d38566017 Mon Sep 17 00:00:00 2001 From: Waldemar Zimpel Date: Wed, 30 Oct 2024 02:51:20 +0100 Subject: Fix: Use FREE_AND_NULL() for releasing workqueue resources See issue #40989 --- src/lib/evloop/workqueue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/evloop/workqueue.h') diff --git a/src/lib/evloop/workqueue.h b/src/lib/evloop/workqueue.h index 9ed504249a..cd892a14c8 100644 --- a/src/lib/evloop/workqueue.h +++ b/src/lib/evloop/workqueue.h @@ -58,7 +58,9 @@ threadpool_t *threadpool_new(int n_threads, void *(*new_thread_state_fn)(void*), void (*free_thread_state_fn)(void*), void *arg); -void threadpool_free(threadpool_t *tp); +void threadpool_free_(threadpool_t *tp); +#define threadpool_free(pool) \ + FREE_AND_NULL(threadpool_t, threadpool_free_, (pool)) replyqueue_t *threadpool_get_replyqueue(threadpool_t *tp); replyqueue_t *replyqueue_new(uint32_t alertsocks_flags); -- cgit v1.2.3-54-g00ecf