avoid file handle leak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7135 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
860cb4affa
commit
31bb54cf27
|
@ -984,7 +984,8 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
|
||||||
if (switch_test_flag(conference, CFLAG_DESTRUCT)) {
|
if (switch_test_flag(conference, CFLAG_DESTRUCT)) {
|
||||||
|
|
||||||
switch_mutex_lock(conference->mutex);
|
switch_mutex_lock(conference->mutex);
|
||||||
|
conference_stop_file(conference, FILE_STOP_ASYNC);
|
||||||
|
conference_stop_file(conference, FILE_STOP_ALL);
|
||||||
/* Close Unused Handles */
|
/* Close Unused Handles */
|
||||||
if (conference->fnode) {
|
if (conference->fnode) {
|
||||||
conference_file_node_t *fnode, *cur;
|
conference_file_node_t *fnode, *cur;
|
||||||
|
@ -1005,6 +1006,14 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
|
||||||
conference->fnode = NULL;
|
conference->fnode = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conference->async_fnode) {
|
||||||
|
switch_memory_pool_t *pool;
|
||||||
|
switch_core_file_close(&conference->async_fnode->fh);
|
||||||
|
pool = conference->async_fnode->pool;
|
||||||
|
conference->async_fnode = NULL;
|
||||||
|
switch_core_destroy_memory_pool(&pool);
|
||||||
|
}
|
||||||
|
|
||||||
switch_mutex_lock(conference->member_mutex);
|
switch_mutex_lock(conference->member_mutex);
|
||||||
for (imember = conference->members; imember; imember = imember->next) {
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
|
@ -2782,7 +2791,7 @@ static switch_status_t conf_api_sub_volume_out(conference_member_t * member, swi
|
||||||
static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_stream_handle_t *stream, int argc, char **argv)
|
static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_stream_handle_t *stream, int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret_status = SWITCH_STATUS_GENERR;
|
int ret_status = SWITCH_STATUS_GENERR;
|
||||||
|
int count = 0;
|
||||||
switch_hash_index_t *hi;
|
switch_hash_index_t *hi;
|
||||||
void *val;
|
void *val;
|
||||||
char *d = ";";
|
char *d = ";";
|
||||||
|
@ -2816,6 +2825,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_s
|
||||||
stream->write_function(stream, "Conference %s (%u member%s%s)\n",
|
stream->write_function(stream, "Conference %s (%u member%s%s)\n",
|
||||||
conference->name,
|
conference->name,
|
||||||
conference->count, conference->count == 1 ? "" : "s", switch_test_flag(conference, CFLAG_LOCKED) ? " locked" : "");
|
conference->count, conference->count == 1 ? "" : "s", switch_test_flag(conference, CFLAG_LOCKED) ? " locked" : "");
|
||||||
|
count++;
|
||||||
if (pretty) {
|
if (pretty) {
|
||||||
conference_list_pretty(conference, stream);
|
conference_list_pretty(conference, stream);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2823,6 +2833,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
count++;
|
||||||
if (pretty) {
|
if (pretty) {
|
||||||
conference_list_pretty(conference, stream);
|
conference_list_pretty(conference, stream);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2830,6 +2841,10 @@ static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!count) {
|
||||||
|
stream->write_function(stream, "No active conferences.\n");
|
||||||
|
}
|
||||||
|
|
||||||
ret_status = SWITCH_STATUS_SUCCESS;
|
ret_status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
return ret_status;
|
return ret_status;
|
||||||
|
|
Loading…
Reference in New Issue