# HG changeset patch # Parent 44a68583de2e05ce49eb2dfba730f63340fc5716 diff --git a/main/pbx.c b/main/pbx.c --- a/main/pbx.c +++ b/main/pbx.c @@ -3907,6 +3907,7 @@ /* Device state changed since last check - notify the watchers */ + ast_rdlock_contexts(); ao2_lock(hints); ao2_lock(hint); @@ -3914,6 +3915,7 @@ /* the extension has been destroyed */ ao2_unlock(hint); ao2_unlock(hints); + ast_unlock_contexts(); continue; } @@ -3934,6 +3936,7 @@ hint->laststate = state; /* record we saw the change */ ao2_unlock(hint); ao2_unlock(hints); + ast_unlock_contexts(); } ao2_iterator_destroy(&i); ast_free(str);