Some protection to prevent ICE session from being destroyed while callback is still running

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1574 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-11-11 07:07:33 +00:00
parent 5b409a4347
commit e74315f8e5
1 changed files with 6 additions and 0 deletions

View File

@ -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);