git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9347 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-08-22 17:00:16 +00:00
parent 98ec172e9a
commit 7ffcb0e624
3 changed files with 25 additions and 5 deletions

View File

@ -2047,6 +2047,7 @@ SWITCH_STANDARD_API(show_function)
int argc;
char *command = NULL, *as = NULL;
switch_core_flag_t cflags = switch_core_flags();
switch_status_t status = SWITCH_STATUS_SUCCESS;
if (session) {
return SWITCH_STATUS_FALSE;
@ -2083,7 +2084,7 @@ SWITCH_STANDARD_API(show_function)
if (!(cflags & SCF_USE_SQL) && command && !strcasecmp(command, "channels")) {
stream->write_function(stream, "-ERR SQL DISABLED NO CHANNEL DATA AVAILABLE!\n");
return SWITCH_STATUS_SUCCESS;
goto end;
}
@ -2091,7 +2092,7 @@ SWITCH_STANDARD_API(show_function)
/* statmements, you must also change show_callback and friends to match! */
if (!command) {
stream->write_function(stream, "-USAGE: %s\n", SHOW_SYNTAX);
return SWITCH_STATUS_SUCCESS;
goto end;
} else if (!strncasecmp(command, "codec", 5) ||
!strncasecmp(command, "dialplan", 8) ||
!strncasecmp(command, "file", 4) ||
@ -2146,7 +2147,7 @@ SWITCH_STANDARD_API(show_function)
}
} else {
stream->write_function(stream, "-USAGE: %s\n", SHOW_SYNTAX);
return SWITCH_STATUS_SUCCESS;
goto end;
}
holder.stream = stream;
@ -2212,9 +2213,15 @@ SWITCH_STANDARD_API(show_function)
holder.stream->write_function(holder.stream, "-ERR Cannot find format %s\n", as);
}
end:
switch_safe_free(mydata);
switch_core_db_close(db);
return SWITCH_STATUS_SUCCESS;
if (db) {
switch_core_db_close(db);
}
return status;
}
SWITCH_STANDARD_API(version_function)

View File

@ -417,6 +417,9 @@ SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
{
int x = 0, last = 0;
switch_hash_index_t *hi;
const void *var;
void *val;
switch_mutex_lock(EVENT_QUEUE_MUTEX);
SYSTEM_RUNNING = 0;
@ -440,6 +443,15 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
last = THREAD_COUNT;
}
for (hi = switch_hash_first(NULL, CUSTOM_HASH); hi; hi = switch_hash_next(hi)) {
switch_event_subclass_t *subclass;
switch_hash_this(hi, &var, NULL, &val);;
if ((subclass = (switch_event_subclass_t *) val)) {
FREE(subclass->name);
FREE(subclass->owner);
FREE(subclass);
}
}
switch_core_hash_destroy(&CUSTOM_HASH);
switch_core_memory_reclaim_events();

View File

@ -1099,6 +1099,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i
}
fprintf(stderr, "Error including %s (%s)\n", pattern, reason);
}
free(dir_path);
}
globfree(&glob_data);