aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-05 17:01:02 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-05 17:01:02 +0000
commit0f1fc9f5a0f8b800d87e885341ea150a952e0f6e (patch)
tree62c0d53de5b88f652704f75ecd880813918fdafc /apps/app_chanspy.c
parent269ae8da300a97b79928a35fb4aa2c7714060d48 (diff)
Minor tweak - we need to lock the channel when we are removing the spy from it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42021 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index d0fdda243..01adbacbe 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -370,7 +370,9 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
/* If a channel still exists on our spy structure then we need to remove ourselves */
if (csth.spy.chan) {
csth.spy.status = CHANSPY_DONE;
+ ast_channel_lock(csth.spy.chan);
ast_channel_spy_remove(csth.spy.chan, &csth.spy);
+ ast_channel_unlock(csth.spy.chan);
}
ast_channel_spy_free(&csth.spy);