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
This commit is contained in:
Vitezslav Novy 2023-09-05 13:51:26 +02:00
parent 06da7b342e
commit 5179f1af24
1 changed files with 1 additions and 1 deletions

View 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);
}