summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2012-03-30 07:53:36 +0000
committerBenny Prijono <bennylp@teluu.com>2012-03-30 07:53:36 +0000
commitb9952b5ebc91d708e8600864efdbda66d84f09c9 (patch)
tree10d4d2d790eccb0cceea8697092ec98f8f79cffd /pjsip
parent6ef0bba7baead4609bcf8ce2ea48d9f7ad0c0dc1 (diff)
Re #1474: merged r3879:3885
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4001 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip/sip_transaction.c8
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c
index 3acef980..0ef1f4d2 100644
--- a/pjsip/src/pjsip/sip_transaction.c
+++ b/pjsip/src/pjsip/sip_transaction.c
@@ -3239,7 +3239,13 @@ static pj_status_t tsx_on_state_terminated( pjsip_transaction *tsx,
pjsip_event *event)
{
pj_assert(tsx->state == PJSIP_TSX_STATE_TERMINATED);
- pj_assert(event->type == PJSIP_EVENT_TIMER);
+
+ /* Ignore events other than timer. This used to be an assertion but
+ * events may genuinely arrive at this state.
+ */
+ if (event->type != PJSIP_EVENT_TIMER) {
+ return PJ_EIGNORED;
+ }
/* Destroy this transaction */
tsx_set_state(tsx, PJSIP_TSX_STATE_DESTROYED,
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index 2806123b..89f2b13d 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -1360,6 +1360,10 @@ PJ_DEF(pj_status_t) pjsua_destroy2(unsigned flags)
{
int i; /* Must be signed */
+ if (pjsua_var.endpt) {
+ PJ_LOG(4,(THIS_FILE, "Shutting down, flags=%d...", flags));
+ }
+
if (pjsua_var.state > PJSUA_STATE_NULL &&
pjsua_var.state < PJSUA_STATE_CLOSING)
{
@@ -1372,7 +1376,12 @@ PJ_DEF(pj_status_t) pjsua_destroy2(unsigned flags)
/* Wait worker threads to quit: */
for (i=0; i<(int)pjsua_var.ua_cfg.thread_cnt; ++i) {
if (pjsua_var.thread[i]) {
- pj_thread_join(pjsua_var.thread[i]);
+ pj_status_t status;
+ status = pj_thread_join(pjsua_var.thread[i]);
+ if (status != PJ_SUCCESS) {
+ PJ_PERROR(4,(THIS_FILE, status, "Error joining worker thread"));
+ pj_thread_sleep(1000);
+ }
pj_thread_destroy(pjsua_var.thread[i]);
pjsua_var.thread[i] = NULL;
}
@@ -1381,8 +1390,6 @@ PJ_DEF(pj_status_t) pjsua_destroy2(unsigned flags)
if (pjsua_var.endpt) {
unsigned max_wait;
- PJ_LOG(4,(THIS_FILE, "Shutting down, flags=%d...", flags));
-
pj_log_push_indent();
/* Terminate all calls. */