]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: listeners/deinit: release accept queue tasklets on deinit
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:42:47 +0000 (18:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:42:47 +0000 (18:42 +0200)
There was no function to release these ones, they were only created
so the patch adds an accept_queue_deinit() call.

src/listener.c

index 721cc4117d8008cb6cdc0239ea30995f43dfae1a..ad293545af725f12091a558efaebf979b32916f6 100644 (file)
@@ -188,6 +188,18 @@ static int accept_queue_init()
 
 REGISTER_CONFIG_POSTPARSER("multi-threaded accept queue", accept_queue_init);
 
+static void accept_queue_deinit()
+{
+       int i;
+
+       for (i = 0; i < global.nbthread; i++) {
+               if (accept_queue_rings[i].tasklet)
+                       tasklet_free(accept_queue_rings[i].tasklet);
+       }
+}
+
+REGISTER_POST_DEINIT(accept_queue_deinit);
+
 #endif // USE_THREAD
 
 /* Memory allocation and initialization of the per_thr field.