mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
FS-3798 --resolve
This commit is contained in:
parent
bad8a69f18
commit
dd8e6089c7
@ -2468,6 +2468,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_event_t *revent = NULL;
|
||||
const char *var;
|
||||
int locked = 1;
|
||||
|
||||
switch_mutex_lock(globals.listener_mutex);
|
||||
prefs.threads++;
|
||||
@ -2477,6 +2478,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||
|
||||
if ((session = listener->session)) {
|
||||
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
|
||||
locked = 0;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -2655,7 +2657,9 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||
if (listener->session) {
|
||||
switch_channel_clear_flag(switch_core_session_get_channel(listener->session), CF_CONTROLLED);
|
||||
switch_clear_flag_locked(listener, LFLAG_SESSION);
|
||||
switch_core_session_rwunlock(listener->session);
|
||||
if (locked) {
|
||||
switch_core_session_rwunlock(listener->session);
|
||||
}
|
||||
} else if (listener->pool) {
|
||||
switch_memory_pool_t *pool = listener->pool;
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
|
Loading…
x
Reference in New Issue
Block a user