]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk: fix wrong counter management in ioqueue objects
authorVitezslav Novy <asterisk@vnovy.net>
Tue, 5 Sep 2023 11:51:26 +0000 (13:51 +0200)
committerAsterisk Development Team <asteriskteam@digium.com>
Fri, 12 Jan 2024 18:32:12 +0000 (18:32 +0000)
In function  rtp_ioqueue_thread_remove counter in ioqueue object is not decreased
which prevents unused ICE TURN threads from being removed.

Resolves: #301
(cherry picked from commit 56244a7371fb8c113e7e6b932b8a2dd3b81a2dcc)

res/res_rtp_asterisk.c

index 5da249d7de05c22a6dd5fd0545e1b73297a18b72..8bfa2711b8477f93f2f971272c8624bce24cb9ab 100644 (file)
@@ -1552,7 +1552,7 @@ static void rtp_ioqueue_thread_remove(struct ast_rtp_ioqueue_thread *ioqueue)
 
        /* If nothing is using this ioqueue thread destroy it */
        AST_LIST_LOCK(&ioqueues);
-       if ((ioqueue->count - 2) == 0) {
+       if ((ioqueue->count -= 2) == 0) {
                destroy = 1;
                AST_LIST_REMOVE(&ioqueues, ioqueue, next);
        }