From 0fb4eb4999cbc39c907f81e512e8ee8b6e4727f8 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 11 Nov 2007 07:07:33 +0000 Subject: Some protection to prevent ICE session from being destroyed while callback is still running git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1574 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath/ice_session.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pjnath/src') diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index 45e1146f..f98c25d9 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -336,6 +336,12 @@ static void destroy_ice(pj_ice_sess *ice, LOG4((ice->obj_name, "Destroying ICE session")); } + /* Let other callbacks finish */ + if (ice->mutex) { + pj_mutex_lock(ice->mutex); + pj_mutex_unlock(ice->mutex); + } + if (ice->completion_timer.id) { pj_timer_heap_cancel(ice->stun_cfg.timer_heap, &ice->completion_timer); -- cgit v1.2.3