diff options
Diffstat (limited to 'channels/chan_local.c')
-rwxr-xr-x | channels/chan_local.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index fc5c74fea..b1998f1c8 100755 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -312,6 +312,10 @@ static int local_hangup(struct ast_channel *ast) p->owner = NULL; ast->pvt->pvt = NULL; + ast_mutex_lock(&usecnt_lock); + usecnt--; + ast_mutex_unlock(&usecnt_lock); + if (!p->owner && !p->chan) { /* Okay, done with the private part now, too. */ glaredetect = p->glaredetect; @@ -452,6 +456,7 @@ static struct ast_channel *local_new(struct local_pvt *p, int state) p->chan = tmp2; ast_mutex_lock(&usecnt_lock); usecnt++; + usecnt++; ast_mutex_unlock(&usecnt_lock); ast_update_use_count(); strncpy(tmp->context, p->context, sizeof(tmp->context)-1); |