Changeset 4885


Ignore:
Timestamp:
Aug 12, 2014 12:12:49 PM (6 years ago)
Author:
nanang
Message:

Misc (re #1751): Remove reference to PJSUA2 Call instance from PJSUA library in PJSUA2 Call destructor regardless the PJSUA state to avoid crash caused by accessing dangling pointer of the Call instance (thanks Thomas Steinacher for the report).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/call.cpp

    r4719 r4885  
    380380Call::~Call() 
    381381{ 
    382     /** 
     382    /* Remove reference to this instance from PJSUA library */ 
     383    if (id != PJSUA_INVALID_ID) 
     384        pjsua_call_set_user_data(id, NULL); 
     385 
     386    /* 
    383387     * If this instance is deleted, also hangup the corresponding call in 
    384388     * PJSUA library. 
    385389     */ 
    386     if (id != PJSUA_INVALID_ID && pjsua_get_state() < PJSUA_STATE_CLOSING) { 
    387         pjsua_call_set_user_data(id, NULL); 
    388         if (isActive()) { 
    389             CallOpParam prm; 
    390             hangup(prm); 
    391         } 
     390    if (pjsua_get_state() < PJSUA_STATE_CLOSING && isActive()) { 
     391        CallOpParam prm; 
     392        hangup(prm); 
    392393    } 
    393394} 
Note: See TracChangeset for help on using the changeset viewer.