[Freeswitch-svn] [commit] r12936 - freeswitch/trunk/src/mod/endpoints/mod_loopback

FreeSWITCH SVN anthm at freeswitch.org
Tue Apr 7 09:06:30 PDT 2009


Author: anthm
Date: Tue Apr  7 11:06:30 2009
New Revision: 12936

Log:
destroy codec

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	Tue Apr  7 11:06:30 2009
@@ -113,10 +113,12 @@
 	
 	if (tech_pvt->read_codec.implementation) {
 		switch_core_codec_destroy(&tech_pvt->read_codec);
+		memset(&tech_pvt->read_codec, 0, sizeof(tech_pvt->read_codec));
 	}
 
 	if (tech_pvt->write_codec.implementation) {
 		switch_core_codec_destroy(&tech_pvt->write_codec);
+		memset(&tech_pvt->write_codec, 0, sizeof(tech_pvt->write_codec));
 	}
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s setup codec %s/%d/%d\n", switch_channel_get_name(channel), iananame, rate, interval);
@@ -366,6 +368,16 @@
 
 	switch_core_timer_destroy(&tech_pvt->timer);
 
+	if (tech_pvt->read_codec.implementation) {
+		switch_core_codec_destroy(&tech_pvt->read_codec);
+		memset(&tech_pvt->read_codec, 0, sizeof(tech_pvt->read_codec));
+	}
+
+	if (tech_pvt->write_codec.implementation) {
+		switch_core_codec_destroy(&tech_pvt->write_codec);
+		memset(&tech_pvt->write_codec, 0, sizeof(tech_pvt->write_codec));
+	}
+
 	return SWITCH_STATUS_SUCCESS;
 }
 



More information about the Freeswitch-svn mailing list