return NULL;
}
+ switch_mutex_lock(globals.mutex);
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);
}
+ switch_mutex_unlock(globals.mutex);
+
return value;
}
#endif
memset(&globals, 0, sizeof(globals));
- switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
+ switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
if ((switch_event_bind_removable(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL, &NODE) != SWITCH_STATUS_SUCCESS)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
DeleteCriticalSection(&timer_section);
#endif
+ if (NODE) {
+ switch_event_unbind(&NODE);
+ }
+
+ switch_mutex_lock(globals.mutex);
if (TIMEZONES_LIST.hash) {
switch_core_hash_destroy(&TIMEZONES_LIST.hash);
}
+ switch_mutex_unlock(globals.mutex);
+
if (TIMEZONES_LIST.pool) {
switch_core_destroy_memory_pool(&TIMEZONES_LIST.pool);
}
- if (NODE) {
- switch_event_unbind(&NODE);
- }
-
return SWITCH_STATUS_SUCCESS;
}