]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix FSCORE-136
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 6 Jun 2008 15:27:16 +0000 (15:27 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 6 Jun 2008 15:27:16 +0000 (15:27 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8779 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_cpp.h
src/switch_cpp.cpp

index 8feb7c036b9171e85af7a96b56d1d51a9bcf81bd..167204b0743a94e160770c8b9621f1de429045d8 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 #define this_check_void() do { if (!this) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "object is not initalized\n");}} while(0)
 #define sanity_check(x) do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
 #define sanity_check_noreturn do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
-#define init_vars() do { allocated = 0; session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; xml_cdr_text = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown";  caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = "";  caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)
+#define init_vars() do { allocated = 0; session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; xml_cdr_text = NULL; memset(&caller_profile, 0, sizeof(caller_profile)); memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown";  caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = "";  caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)
 //// C++ Interface: switch_to_cpp_mempool//// Description: This class allows for overloading the new operator to allocate from a switch_memory_pool_t//// Author: Yossi Neiman <freeswitch@cartissolutions.com>, (C) 2007//// Copyright: See COPYING file that comes with this distribution//
 #if 0
 #ifndef SWITCHTOMEMPOOL
index c806bd0cccbd76a8579729da40bf4a7b6f91150a..07cea5c2fcc37a7ee81774db48b5eb6b399364c0 100644 (file)
@@ -402,7 +402,15 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::~CoreSession()
 {
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::~CoreSession desctructor\n");
        switch_channel_t *channel = NULL;
-
+       
+       init_vars();
+       this_check_void();
+       
+       switch_safe_free(xml_cdr_text);
+       switch_safe_free(uuid); 
+       switch_safe_free(tts_name);
+       switch_safe_free(voice_name);
+       
        if (session) {
                channel = switch_core_session_get_channel(session);
                if (switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
@@ -411,10 +419,7 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::~CoreSession()
                switch_core_session_rwunlock(session);
        }
 
-       switch_safe_free(xml_cdr_text);
-       switch_safe_free(uuid); 
-       switch_safe_free(tts_name);
-       switch_safe_free(voice_name);
+       
 }
 
 SWITCH_DECLARE(char *) CoreSession::getXMLCDR()
@@ -783,7 +788,6 @@ SWITCH_DECLARE(int) CoreSession::originate(CoreSession *a_leg_session, char *des
        switch_call_cause_t cause;
 
        this_check(0);
-       sanity_check(0);
 
        cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;