Author: mikej Date: Tue Dec 18 13:14:00 2007 New Revision: 6870 Modified: freeswitch/trunk/src/switch_cpp.cpp Log: wrong fix to avoid seg. The threadstate needs to be moved to the private so that it's not dependent on the switch_core_session_t like in python. Modified: freeswitch/trunk/src/switch_cpp.cpp ============================================================================== --- freeswitch/trunk/src/switch_cpp.cpp (original) +++ freeswitch/trunk/src/switch_cpp.cpp Tue Dec 18 13:14:00 2007 @@ -326,7 +326,7 @@ // no valid channel. since the threadstate is stored in the channel, and there // is none, if we try to call begin_alllow_threads it will fail miserably. // use the 'a leg session' to do the thread swapping stuff. - a_leg_session->begin_allow_threads(); + if (a_leg_session) a_leg_session->begin_allow_threads(); if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n"); @@ -347,11 +347,11 @@ } - a_leg_session->end_allow_threads(); + if (a_leg_session) a_leg_session->end_allow_threads(); return SWITCH_STATUS_SUCCESS; failed: - a_leg_session->end_allow_threads(); + if (a_leg_session) a_leg_session->end_allow_threads(); return SWITCH_STATUS_FALSE; }