add missing code to free pools in certian conditions that were overlooked

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6699 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-12-12 14:16:24 +00:00
parent 54309a7b5e
commit 59e8656698
3 changed files with 26 additions and 3 deletions

View File

@@ -143,10 +143,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t
SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
{
switch_status_t status;
switch_assert(fh != NULL);
switch_assert(fh->file_interface != NULL);
switch_clear_flag(fh, SWITCH_FILE_OPEN);
return fh->file_interface->file_close(fh);
status = fh->file_interface->file_close(fh);
if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
switch_core_destroy_memory_pool(&fh->memory_pool);
}
return status;
}