summaryrefslogtreecommitdiff
path: root/pjnath
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2013-01-11 04:10:08 +0000
committerNanang Izzuddin <nanang@teluu.com>2013-01-11 04:10:08 +0000
commit18b75f037db7b115746ef62820db017422503290 (patch)
tree20861e1d4b279aa3de70dc53d4d41c4a5b9ee6c9 /pjnath
parent602f03ac537654acb001029451b27062251f8211 (diff)
Fix #1604: crash caused by double destructions in ICE stream transport.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4314 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r--pjnath/src/pjnath/ice_strans.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c
index b83c7514..a798586b 100644
--- a/pjnath/src/pjnath/ice_strans.c
+++ b/pjnath/src/pjnath/ice_strans.c
@@ -741,14 +741,14 @@ PJ_DEF(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st)
{
PJ_ASSERT_RETURN(ice_st, PJ_EINVAL);
+ sess_add_ref(ice_st);
ice_st->destroy_req = PJ_TRUE;
- if (pj_atomic_get(ice_st->busy_cnt) > 0) {
+ if (sess_dec_ref(ice_st)) {
PJ_LOG(5,(ice_st->obj_name,
"ICE strans object is busy, will destroy later"));
return PJ_EPENDING;
}
-
- destroy_ice_st(ice_st);
+
return PJ_SUCCESS;
}
@@ -770,7 +770,7 @@ static pj_bool_t sess_dec_ref(pj_ice_strans *ice_st)
int count = pj_atomic_dec_and_get(ice_st->busy_cnt);
pj_assert(count >= 0);
if (count==0 && ice_st->destroy_req) {
- pj_ice_strans_destroy(ice_st);
+ destroy_ice_st(ice_st);
return PJ_FALSE;
} else {
return PJ_TRUE;