diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-10-12 01:27:40 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-10-12 01:27:40 +0000 |
commit | cc9e61e2abaf2cb5e225a2263ad2b0c6d4f803d2 (patch) | |
tree | 8464585c5b9f04ea17991470dfdb4792da51abce /pjsip/src/pjsip-simple/publishc.c | |
parent | 6a4caed664f70e677c80c0002a087f74d52f3af0 (diff) |
Related to ticket #411 (Cannot update account presence's status while previous PUBLISH is in progress):
- Crash in timer if publication session is terminated prematurely. To reproduce: publish two events in quick successions, e.g. by pressing "t" in pjsua couple of times. The publication session will be terminated with PJ_EBUSY status, and crash may occur when timer heap is polled.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2939 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-simple/publishc.c')
-rw-r--r-- | pjsip/src/pjsip-simple/publishc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pjsip/src/pjsip-simple/publishc.c b/pjsip/src/pjsip-simple/publishc.c index 0e9c073c..6ba867a8 100644 --- a/pjsip/src/pjsip-simple/publishc.c +++ b/pjsip/src/pjsip-simple/publishc.c @@ -174,6 +174,12 @@ PJ_DEF(pj_status_t) pjsip_publishc_destroy(pjsip_publishc *pubc) pubc->_delete_flag = 1; pubc->cb = NULL; } else { + /* Cancel existing timer, if any */ + if (pubc->timer.id != 0) { + pjsip_endpt_cancel_timer(pubc->endpt, &pubc->timer); + pubc->timer.id = 0; + } + pjsip_endpt_release_pool(pubc->endpt, pubc->pool); } |