diff options
author | Liong Sauw Ming <ming@teluu.com> | 2011-12-20 10:27:39 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2011-12-20 10:27:39 +0000 |
commit | 3a73a091c1b923f2c1fe94e45770127b4300c7e6 (patch) | |
tree | 57d536ba7da435abf157d4d0dbb11774286671dc /pjsip/src | |
parent | 7d9daa07205d5fd4dc560687bb3715f68113bcc5 (diff) |
Fixed #1430: Crash when dialog is prematurely destroyed during outgoing call.
We do this by temporarily incrementing dialog session until the invite session is created.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3918 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index ece37d51..020570cd 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -364,6 +364,9 @@ on_make_call_med_tp_complete(pjsua_call_id call_id, */ pjsip_dlg_inc_lock(dlg); + /* Decrement dialog session. */ + pjsip_dlg_dec_session(dlg, &pjsua_var.mod); + if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error initializing media channel", status); goto on_error; @@ -723,6 +726,12 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id, goto on_error; } + /* Temporarily increment dialog session. Without this, dialog will be + * prematurely destroyed if dec_lock() is called on the dialog before + * the invite session is created. + */ + pjsip_dlg_inc_session(dlg, &pjsua_var.mod); + /* Done. */ if (p_call_id) |