]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8721 #resolve [Bug removal at call end causes eavesdrop memory leak] #comment...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Jan 2016 19:29:29 +0000 (13:29 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 15 Jan 2016 19:29:29 +0000 (13:29 -0600)
src/switch_core_media_bug.c

index 6f247d2102e01cd08c08fe53953e8eaf8d9e4c2b..c97f277b4baed0fd7e5639787cc0353c4e05e331 100644 (file)
@@ -1101,7 +1101,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all_function(switch
        if (session->bugs) {
                switch_thread_rwlock_wrlock(session->bug_rwlock);
                for (bp = session->bugs; bp; bp = bp->next) {
-                       if ((bp->thread_id && bp->thread_id != switch_thread_self()) || switch_test_flag(bp, SMBF_LOCK)) {
+                       if (!switch_test_flag(session, SSF_DESTROYABLE) && 
+                               ((bp->thread_id && bp->thread_id != switch_thread_self()) || switch_test_flag(bp, SMBF_LOCK))) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BUG is thread locked skipping.\n");
                                continue;
                        }