diff options
Diffstat (limited to 'pjsip/src/pjsua2/call.cpp')
-rw-r--r-- | pjsip/src/pjsua2/call.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pjsip/src/pjsua2/call.cpp b/pjsip/src/pjsua2/call.cpp index b196d5d4..1e4e72f3 100644 --- a/pjsip/src/pjsua2/call.cpp +++ b/pjsip/src/pjsua2/call.cpp @@ -379,16 +379,17 @@ Call::Call(Account& account, int call_id) Call::~Call() { - /** + /* Remove reference to this instance from PJSUA library */ + if (id != PJSUA_INVALID_ID) + pjsua_call_set_user_data(id, NULL); + + /* * If this instance is deleted, also hangup the corresponding call in * PJSUA library. */ - if (id != PJSUA_INVALID_ID && pjsua_get_state() < PJSUA_STATE_CLOSING) { - pjsua_call_set_user_data(id, NULL); - if (isActive()) { - CallOpParam prm; - hangup(prm); - } + if (pjsua_get_state() < PJSUA_STATE_CLOSING && isActive()) { + CallOpParam prm; + hangup(prm); } } |