mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
fix hanguphook order of operations vs destroy method issue in c++ code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12730 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -887,6 +887,10 @@ SWITCH_DECLARE(bool) CoreSession::answered() {
|
||||
SWITCH_DECLARE(void) CoreSession::destroy(void)
|
||||
{
|
||||
this_check_void();
|
||||
|
||||
if (!allocated) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch_safe_free(xml_cdr_text);
|
||||
switch_safe_free(uuid);
|
||||
@@ -903,7 +907,7 @@ SWITCH_DECLARE(void) CoreSession::destroy(void)
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "destroy/unlink session from object\n");
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -912,7 +916,7 @@ SWITCH_DECLARE(void) CoreSession::destroy(void)
|
||||
channel = NULL;
|
||||
}
|
||||
|
||||
allocated = 0;
|
||||
init_vars();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user