FSCORE-297 FSCORE-305 FSCORE-315

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12392 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-03-03 20:16:05 +00:00
parent 790f2c9b64
commit 8d965c32b2
8 changed files with 171 additions and 228 deletions

View File

@@ -249,6 +249,20 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
return val;
}
static void switch_core_unset_variables(void)
{
switch_hash_index_t *hi;
const void *var;
void *val;
switch_mutex_lock(runtime.global_var_mutex);
for (hi = switch_hash_first(NULL, runtime.global_vars); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
free(val);
}
switch_mutex_unlock(runtime.global_var_mutex);
}
SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value)
{
char *val;
@@ -1488,6 +1502,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
switch_log_shutdown();
switch_core_unset_variables();
switch_core_memory_stop();
if (runtime.console && runtime.console != stdout && runtime.console != stderr) {