diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e62232a4edf63ecd0447abb0765e0920d916d2c9..feb3abf630fb21cb74e1a8a9fc6d6029d0bf2a26 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1032,6 +1032,11 @@ static int sip_hangup(struct ast_channel *ast) p->owner = NULL; ast->pvt->pvt = NULL; + ast_mutex_lock(&usecnt_lock); + usecnt--; + ast_mutex_unlock(&usecnt_lock); + ast_update_use_count(); + needdestroy = 1; /* Start the process if it's not already started */ if (!p->alreadygone && strlen(p->initreq.data)) {