Index: xivo-6929/res/res_rtp_asterisk.c
===================================================================
--- xivo-6929.orig/res/res_rtp_asterisk.c
+++ xivo-6929/res/res_rtp_asterisk.c
@@ -1558,7 +1558,7 @@ static void rtp_ioqueue_thread_remove(st
 
 	/* 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);
 	}
