Ignore:
Timestamp:
May 31, 2018 9:58:00 AM (17 months ago)
Author:
nanang
Message:

Fix #2117: Add PJSUA2 API Account::shutdown() to avoid race condition between Account derived class destructor and onRegState callback.

File:
1 edited

Legend:

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

    r5800 r5801  
    820820     * PJSUA library. 
    821821     */ 
     822    shutdown(); 
     823} 
     824 
     825void Account::create(const AccountConfig &acc_cfg, 
     826                     bool make_default) throw(Error) 
     827{ 
     828    pjsua_acc_config pj_acc_cfg; 
     829     
     830    acc_cfg.toPj(pj_acc_cfg); 
     831    pj_acc_cfg.user_data = (void*)this; 
     832    PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) ); 
     833} 
     834 
     835void Account::shutdown() 
     836{ 
    822837    if (isValid() && pjsua_get_state() < PJSUA_STATE_CLOSING) { 
    823838        // Cleanup buddies in the buddy list 
     
    835850} 
    836851 
    837 void Account::create(const AccountConfig &acc_cfg, 
    838                      bool make_default) throw(Error) 
    839 { 
    840     pjsua_acc_config pj_acc_cfg; 
    841      
    842     acc_cfg.toPj(pj_acc_cfg); 
    843     pj_acc_cfg.user_data = (void*)this; 
    844     PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) ); 
    845 } 
    846  
    847852void Account::modify(const AccountConfig &acc_cfg) throw(Error) 
    848853{ 
Note: See TracChangeset for help on using the changeset viewer.