summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-07-18 23:51:49 +0000
committerBenny Prijono <bennylp@teluu.com>2008-07-18 23:51:49 +0000
commitc2574cdf8965f1f7f77a77152c49e930af36a15b (patch)
treed3a244617f76fe88abb668dad38c9f21e405fc74
parenta331abeec9382f40293a5b3c7e4dc2163f6ad734 (diff)
Related to ticket #192: crash when shutting down pjsua if buddy pool has been destroyed when presence subscription callback is called
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2157 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index dbc917be..bd21a4b8 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -1093,6 +1093,14 @@ PJ_DEF(pj_status_t) pjsua_destroy(void)
PJ_LOG(4,(THIS_FILE, "Destroying..."));
+ /* Must destroy endpoint first before destroying pools in
+ * buddies or accounts, since shutting down transaction layer
+ * may emit events which trigger some buddy or account callbacks
+ * to be called.
+ */
+ pjsip_endpt_destroy(pjsua_var.endpt);
+ pjsua_var.endpt = NULL;
+
/* Destroy pool in the buddy object */
for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.buddy); ++i) {
if (pjsua_var.buddy[i].pool) {
@@ -1108,9 +1116,6 @@ PJ_DEF(pj_status_t) pjsua_destroy(void)
pjsua_var.acc[i].pool = NULL;
}
}
-
- pjsip_endpt_destroy(pjsua_var.endpt);
- pjsua_var.endpt = NULL;
}
/* Destroy mutex */