]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #10650)
authorJoshua Colp <jcolp@digium.com>
Wed, 5 Sep 2007 13:11:48 +0000 (13:11 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 5 Sep 2007 13:11:48 +0000 (13:11 +0000)
Reported by: tacvbo
Only print out that the spy was removed while holding the spy lock.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81492 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 03fd68f8210f6abbcab59a7200e48a1e39ad7c0b..eaa325d32974051d0c55eef6e496bdf123a79a66 100644 (file)
@@ -1449,13 +1449,11 @@ static void spy_detach(struct ast_channel_spy *spy, struct ast_channel *chan)
                /* Poke the spy if needed */
                if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
                        ast_cond_signal(&spy->trigger);
+               if (option_debug)
+                       ast_log(LOG_DEBUG, "Spy %s removed from channel %s\n", spy->type, chan->name);
                ast_mutex_unlock(&spy->lock);
        }
 
-       /* Print it out while we still have a lock so the structure can't go away (if signalled above) */
-       if (option_debug)
-               ast_log(LOG_DEBUG, "Spy %s removed from channel %s\n", spy->type, chan->name);
-
        return;
 }