[Core] Fix multiple missing session unlocks in switch_core_media.c

This commit is contained in:
Andrey Volk 2020-05-19 02:48:02 +04:00
parent bb6ec01d1e
commit 09d4ec6433
1 changed files with 9 additions and 4 deletions

View File

@ -6791,6 +6791,7 @@ static void *SWITCH_THREAD_FUNC video_write_thread(switch_thread_t *thread, void
} }
if (!(smh = session->media_handle)) { if (!(smh = session->media_handle)) {
switch_core_session_rwunlock(session);
return NULL; return NULL;
} }
@ -7301,12 +7302,14 @@ static void *SWITCH_THREAD_FUNC text_helper_thread(switch_thread_t *thread, void
return NULL; return NULL;
} }
mh->ready = 1;
if (!(smh = session->media_handle)) { if (!(smh = session->media_handle)) {
switch_core_session_rwunlock(session);
mh->ready = -1;
return NULL; return NULL;
} }
mh->ready = 1;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
if (switch_channel_var_true(session->channel, "fire_text_events")) { if (switch_channel_var_true(session->channel, "fire_text_events")) {
@ -7460,12 +7463,14 @@ static void *SWITCH_THREAD_FUNC video_helper_thread(switch_thread_t *thread, voi
return NULL; return NULL;
} }
mh->ready = 1;
if (!(smh = session->media_handle)) { if (!(smh = session->media_handle)) {
switch_core_session_rwunlock(session);
mh->ready = -1;
return NULL; return NULL;
} }
mh->ready = 1;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
switch_core_autobind_cpu(); switch_core_autobind_cpu();