Changeset 4699


Ignore:
Timestamp:
Dec 19, 2013 3:49:05 AM (7 years ago)
Author:
nanang
Message:

Re #1519: Fixed assertion and crash in Endpoint destruction caused by late destroy (after pjsua destroyed) and double deletes of audio device media.

Location:
pjproject/branches/projects/pjsua2/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp

    r4678 r4699  
    369369 
    370370    /** 
    371      * Custom log writer, if required. This instance will be destroyed 
    372      * by the endpoint when the endpoint is destroyed. 
     371     * Custom log writer, if required. 
    373372     */ 
    374373    LogWriter           *writer; 
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/endpoint.cpp

    r4692 r4699  
    384384    } 
    385385 
    386     delete writer; 
    387      
    388386    while(mediaList.size() > 0) { 
    389387        AudioMedia *cur_media = mediaList[0]; 
     
    13031301    status = pjsua_destroy2(flags); 
    13041302 
    1305     delete this->writer; 
    13061303    this->writer = NULL; 
    13071304 
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp

    r4692 r4699  
    155155void AudioMedia::unregisterMediaPort() 
    156156{ 
    157     if (id != PJSUA_INVALID_ID) 
     157    if (id != PJSUA_INVALID_ID) { 
    158158        pjsua_conf_remove_port(id); 
     159        id = PJSUA_INVALID_ID; 
     160    } 
    159161 
    160162    if (mediaPool) { 
     
    163165        pj_caching_pool_destroy(&mediaCachingPool); 
    164166    } 
    165  
    166     id = PJSUA_INVALID_ID; 
    167167 
    168168    Endpoint::instance().mediaRemove(*this); 
     
    387387public: 
    388388    DevAudioMedia(); 
     389    ~DevAudioMedia(); 
    389390}; 
    390391 
     
    395396} 
    396397 
     398DevAudioMedia::~DevAudioMedia() 
     399{ 
     400    /* Avoid removing this port (conf port id=0) from conference */ 
     401    this->id = PJSUA_INVALID_ID; 
     402} 
     403 
    397404/////////////////////////////////////////////////////////////////////////////// 
    398405/* Audio device operations. */ 
     
    405412AudDevManager::~AudDevManager() 
    406413{ 
    407     delete devMedia; 
     414    // At this point, devMedia should have been cleaned up by Endpoint, 
     415    // as AudDevManager destructor is called after Endpoint destructor. 
     416    //delete devMedia; 
     417     
    408418    clearAudioDevList(); 
    409419} 
Note: See TracChangeset for help on using the changeset viewer.