summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_local.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 453375319..00c058da1 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -692,11 +692,11 @@ static int local_hangup(struct ast_channel *ast)
ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
ast_module_user_remove(p->u_chan);
} else {
- p->owner = NULL;
ast_module_user_remove(p->u_owner);
while (p->chan && ast_channel_trylock(p->chan)) {
DEADLOCK_AVOIDANCE(&p->lock);
}
+ p->owner = NULL;
if (p->chan) {
ast_queue_hangup(p->chan);
ast_channel_unlock(p->chan);