From 235bf0c075e5966a1622791b0f5af454f0afb6f0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 31 Oct 2008 15:20:18 +0000 Subject: [PATCH] one more for good measure git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10208 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 46ab46dadd..d6ddd5e18a 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -57,10 +57,11 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(const char *u if ((session = switch_core_hash_find(session_manager.session_table, uuid_str))) { /* Acquire a read lock on the session */ #ifdef SWITCH_DEBUG_RWLOCKS - if (switch_channel_get_state(session->channel) >= CS_HANGUP || + if (switch_channel_get_state(session->channel) >= CS_HANGUP || switch_test_flag(session, SSF_DESTROYED) || switch_core_session_perform_read_lock(session, file, func, line) != SWITCH_STATUS_SUCCESS) { #else - if (switch_channel_get_state(session->channel) >= CS_HANGUP || switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) { + if (switch_channel_get_state(session->channel) >= CS_HANGUP || switch_test_flag(session, SSF_DESTROYED) || + switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) { #endif /* not available, forget it */ session = NULL;