diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-11-11 07:07:33 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-11-11 07:07:33 +0000 |
commit | 0fb4eb4999cbc39c907f81e512e8ee8b6e4727f8 (patch) | |
tree | ff09077c2d34159583fab209975b6eacb4c24683 /pjnath/src | |
parent | 40beec4f452e1c00e00a816846a22ba11260932c (diff) |
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
Diffstat (limited to 'pjnath/src')
-rw-r--r-- | pjnath/src/pjnath/ice_session.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); |