From: Willy Tarreau Date: Wed, 27 Apr 2022 16:53:07 +0000 (+0200) Subject: CLEANUP: connections/deinit: destroy the idle_conns tasks X-Git-Tag: v2.6-dev8~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faafe4bf163fc7cc1ba4ec370f46b7f44c371a1f;p=thirdparty%2Fhaproxy.git CLEANUP: connections/deinit: destroy the idle_conns tasks This adds a deinit_idle_conns() function that's called on deinit to release the per-thread idle connection management tasks. The global task was already taken care of. --- diff --git a/src/connection.c b/src/connection.c index d37ad76d96..abe4fd66e4 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2437,3 +2437,14 @@ static int deallocate_mux_cleanup(void) return 1; } REGISTER_PER_THREAD_FREE(deallocate_mux_cleanup); + +static void deinit_idle_conns(void) +{ + int i; + + for (i = 0; i < global.nbthread; i++) { + if (idle_conns[i].cleanup_task) + task_destroy(idle_conns[i].cleanup_task); + } +} +REGISTER_POST_DEINIT(deinit_idle_conns);