提交 ab852633 authored 作者: Brian West's avatar Brian West 提交者: Michael Jerris

FS-7761 [core] fix shutdown races running api commands during shutdown

上级 4fc6d2f7
......@@ -2070,8 +2070,8 @@ SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_inte
#define HASH_FUNC(_kind_) SWITCH_DECLARE(switch_##_kind_##_interface_t *) switch_loadable_module_get_##_kind_##_interface(const char *name) \
{ \
switch_##_kind_##_interface_t *i; \
if ((i = switch_core_hash_find_locked(loadable_modules._kind_##_hash, name, loadable_modules.mutex))) { \
switch_##_kind_##_interface_t *i = NULL; \
if (loadable_modules._kind_##_hash && (i = switch_core_hash_find_locked(loadable_modules._kind_##_hash, name, loadable_modules.mutex))) { \
PROTECT_INTERFACE(i); \
} \
return i; \
......
......@@ -1362,7 +1362,11 @@ SWITCH_DECLARE(const char *) switch_lookup_timezone(const char *tz_name)
{
char *value = NULL;
if (tz_name && (value = switch_core_hash_find(TIMEZONES_LIST.hash, tz_name)) == NULL) {
if (zstr(tz_name) || !TIMEZONES_LIST.hash) {
return NULL;
}
if ((value = switch_core_hash_find(TIMEZONES_LIST.hash, tz_name)) == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timezone '%s' not found!\n", tz_name);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论