提交 ec27618f authored 作者: Michael Jerris's avatar Michael Jerris

don't segfault after starting sofia, upon xml_open_config lookup failure for the…

don't segfault after starting sofia, upon xml_open_config lookup failure for the profile from launch_sofia_worker_thread
上级 187fe4e1
...@@ -2252,7 +2252,11 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -2252,7 +2252,11 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
sofia_clear_pflag_locked(profile, PFLAG_SHUTDOWN); sofia_clear_pflag_locked(profile, PFLAG_SHUTDOWN);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n");
switch_thread_join(&st, worker_thread); if ( worker_thread ) {
switch_thread_join(&st, worker_thread);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: Sofia worker thead failed to start\n");
}
sanity = 4; sanity = 4;
while (profile->inuse) { while (profile->inuse) {
......
...@@ -1169,6 +1169,11 @@ SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_ ...@@ -1169,6 +1169,11 @@ SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_
*/ */
SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd) SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd)
{ {
if ( !thd ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: Attempting to join thread that does not exist\n");
return SWITCH_STATUS_FALSE;
}
return apr_thread_join((apr_status_t *) retval, (apr_thread_t *) thd); return apr_thread_join((apr_status_t *) retval, (apr_thread_t *) thd);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论