[Freeswitch-svn] [commit] r6699 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Wed Dec 12 09:16:24 EST 2007


Author: anthm
Date: Wed Dec 12 09:16:24 2007
New Revision: 6699

Modified:
   freeswitch/trunk/src/switch_core_asr.c
   freeswitch/trunk/src/switch_core_directory.c
   freeswitch/trunk/src/switch_core_file.c

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

Modified: freeswitch/trunk/src/switch_core_asr.c
==============================================================================
--- freeswitch/trunk/src/switch_core_asr.c	(original)
+++ freeswitch/trunk/src/switch_core_asr.c	Wed Dec 12 09:16:24 2007
@@ -125,9 +125,17 @@
 
 SWITCH_DECLARE(switch_status_t) switch_core_asr_close(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
 {
+	switch_status_t status;
+
 	switch_assert(ah != NULL);
 
-	return ah->asr_interface->asr_close(ah, flags);
+	status = ah->asr_interface->asr_close(ah, flags);
+
+	if (switch_test_flag(ah, SWITCH_ASR_FLAG_FREE_POOL)) {
+		switch_core_destroy_memory_pool(&ah->memory_pool);
+	}
+
+	return status;
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)

Modified: freeswitch/trunk/src/switch_core_directory.c
==============================================================================
--- freeswitch/trunk/src/switch_core_directory.c	(original)
+++ freeswitch/trunk/src/switch_core_directory.c	Wed Dec 12 09:16:24 2007
@@ -73,6 +73,14 @@
 
 SWITCH_DECLARE(switch_status_t) switch_core_directory_close(switch_directory_handle_t *dh)
 {
-	return dh->directory_interface->directory_close(dh);
+	switch_status_t status;
+
+	status = dh->directory_interface->directory_close(dh);
+
+	if (switch_test_flag(dh, SWITCH_DIRECTORY_FLAG_FREE_POOL)) {
+		switch_core_destroy_memory_pool(&dh->memory_pool);
+	}
+
+	return status;
 }
 

Modified: freeswitch/trunk/src/switch_core_file.c
==============================================================================
--- freeswitch/trunk/src/switch_core_file.c	(original)
+++ freeswitch/trunk/src/switch_core_file.c	Wed Dec 12 09:16:24 2007
@@ -143,10 +143,17 @@
 
 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;
 }



More information about the Freeswitch-svn mailing list