FSCORE-341

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12728 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-03-24 14:54:13 +00:00
parent 7b52ef1305
commit 523e0653ed
4 changed files with 26 additions and 16 deletions

View File

@@ -888,22 +888,28 @@ SWITCH_DECLARE(void) CoreSession::destroy(void)
{
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);
switch_safe_free(voice_name);
if (session) {
if (!channel) {
channel = switch_core_session_get_channel(session);
}
if (channel) {
switch_channel_set_private(channel, "CoreSession", NULL);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "destroy/unlink session from object\n");
if (switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
if (switch_channel_up(channel) && switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
switch_core_session_rwunlock(session);
session = NULL;
channel = NULL;
}
allocated = 0;