]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 3 May 2008 16:36:12 +0000 (16:36 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 3 May 2008 16:36:12 +0000 (16:36 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8259 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_lua/freeswitch_lua.cpp

index 253668edd1c0cfdadf713255ecd7e63f49a2bb0a..d4b9c4388223a27340fb69eeca5f4ee4e9090e94 100644 (file)
@@ -21,10 +21,16 @@ Session::Session(switch_core_session_t *new_session) : CoreSession(new_session)
 static switch_status_t lua_hanguphook(switch_core_session_t *session_hungup);
 Session::~Session()
 {
+
+       if (hangup_func_str) {
+               if (session) {
+                       switch_core_event_hook_remove_state_change(session, lua_hanguphook);
+               }
+               free(hangup_func_str);
+       }
+       
        switch_safe_free(cb_function);
        switch_safe_free(cb_arg);
-       switch_safe_free(hangup_func_str);
-       switch_core_event_hook_remove_state_change(session, lua_hanguphook);
 }
 
 bool Session::begin_allow_threads()