aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index fa396bce4..c9452d8fd 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -554,8 +554,12 @@ static int local_hangup(struct ast_channel *ast)
} else {
p->owner = NULL;
ast_module_user_remove(p->u_owner);
+ while (p->chan && ast_channel_trylock(p->chan)) {
+ DEADLOCK_AVOIDANCE(&p->lock);
+ }
if (p->chan) {
ast_queue_hangup(p->chan);
+ ast_channel_unlock(p->chan);
}
}