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:
Anthony Minessale
2009-03-24 15:30:08 +00:00
parent 80e6a1bd0f
commit 4025b42470
15 changed files with 280 additions and 27 deletions
+14 -5
View File
@@ -21,8 +21,14 @@ Session::Session(switch_core_session_t *new_session):CoreSession(new_session)
hh = mark = 0;
}
static switch_status_t lua_hanguphook(switch_core_session_t *session_hungup);
Session::~Session()
void Session::destroy(void)
{
if (!allocated) {
return;
}
if (session) {
if (!channel) {
@@ -30,8 +36,6 @@ Session::~Session()
}
switch_channel_set_private(channel, "CoreSession", NULL);
switch_core_event_hook_remove_state_change(session, lua_hanguphook);
session = NULL;
channel = NULL;
}
switch_safe_free(hangup_func_str);
@@ -39,8 +43,13 @@ Session::~Session()
switch_safe_free(cb_function);
switch_safe_free(cb_arg);
init_vars();
CoreSession::destroy();
}
Session::~Session()
{
destroy();
}
bool Session::begin_allow_threads()