From c275ee9e54f5eb94bf03a52dc86cc839291c66a9 Mon Sep 17 00:00:00 2001 From: Vitezslav Novy Date: Tue, 5 Sep 2023 13:51:26 +0200 Subject: [PATCH] res_rtp_asterisk: fix wrong counter management in ioqueue objects 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 5179f1af243bc1d3a3caa28baeae93ac85e15730) --- res/res_rtp_asterisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 5da249d7de..8bfa2711b8 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -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); }