[Freeswitch-svn] [commit] r12718 - in freeswitch/trunk/src: . mod/languages/mod_lua

FreeSWITCH SVN anthm at freeswitch.org
Sun Mar 22 14:32:08 PDT 2009


Author: anthm
Date: Sun Mar 22 16:32:08 2009
New Revision: 12718

Log:
update

Modified:
   freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
   freeswitch/trunk/src/switch_cpp.cpp

Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	Sun Mar 22 16:32:08 2009
@@ -32,7 +32,7 @@
 		if (session) {
 			switch_core_event_hook_remove_state_change(session, lua_hanguphook);
 		}
-		free(hangup_func_str);
+		switch_safe_free(hangup_func_str);
 	}
 
 	switch_safe_free(hangup_func_arg);
@@ -128,6 +128,16 @@
 		if (!switch_strlen_zero(err)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
 		}
+
+		if (channel) {
+			switch_channel_set_private(channel, "CoreSession", NULL);
+		}
+
+		if (session) {
+			switch_core_event_hook_remove_state_change(session, lua_hanguphook);
+		}
+		switch_safe_free(hangup_func_str);
+
 	}
 }
 
@@ -142,7 +152,10 @@
 		channel = switch_core_session_get_channel(session_hungup);
 
 		if (channel) {
-			coresession = (Session *) switch_channel_get_private(channel, "CoreSession");
+			void *vs = switch_channel_get_private(channel, "CoreSession");
+			if (vs) {
+				coresession = (Session *) vs;
+			}
 		}
 		
 		if (!(coresession && coresession->hook_state)) {

Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp	(original)
+++ freeswitch/trunk/src/switch_cpp.cpp	Sun Mar 22 16:32:08 2009
@@ -888,6 +888,10 @@
 {
 	this_check_void();
 
+	if (channel) {
+		switch_channel_set_private(channel, "CoreSession", NULL);
+	}
+	
 	switch_safe_free(xml_cdr_text);
 	switch_safe_free(uuid);	
 	switch_safe_free(tts_name);



More information about the Freeswitch-svn mailing list