Ignore:
Timestamp:
Sep 23, 2019 10:47:05 PM (3 years ago)
Author:
riza
Message:

Close #2232: Crash on Endpoint::libDestroy() when there is an active call.

File:
1 edited

Legend:

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

    r6051 r6074  
    479479 * Endpoint instance 
    480480 */ 
    481 Endpoint::Endpoint() 
    482 : writer(NULL), threadDescMutex(NULL), mediaListMutex(NULL),  
    483   mainThreadOnly(false), mainThread(NULL), pendingJobSize(0) 
     481Endpoint::Endpoint(): 
     482#if !DEPRECATED_FOR_TICKET_2232 
     483mediaListMutex(NULL), 
     484#endif 
     485writer(NULL), threadDescMutex(NULL), mainThreadOnly(false), 
     486mainThread(NULL), pendingJobSize(0) 
    484487{ 
    485488    if (instance_) { 
     
    505508    } 
    506509 
     510#if !DEPRECATED_FOR_TICKET_2232 
    507511    clearCodecInfoList(codecInfoList); 
    508512    clearCodecInfoList(videoCodecInfoList); 
     513#endif 
    509514 
    510515    try { 
     
    17141719                                              &threadDescMutex) ); 
    17151720 
     1721#if !DEPRECATED_FOR_TICKET_2232 
    17161722    PJSUA2_CHECK_EXPR( pj_mutex_create_recursive(pjsua_var.pool, "mediaList", 
    17171723                                                 &mediaListMutex) ); 
     1724#endif 
    17181725} 
    17191726 
     
    17831790    } 
    17841791 
     1792#if !DEPRECATED_FOR_TICKET_2232 
    17851793    while(mediaList.size() > 0) { 
    17861794        AudioMedia *cur_media = mediaList[0]; 
     
    17921800        mediaListMutex = NULL; 
    17931801    } 
     1802#endif 
    17941803 
    17951804    status = pjsua_destroy2(flags); 
     
    20472056} 
    20482057 
     2058#if !DEPRECATED_FOR_TICKET_2232 
    20492059const AudioMediaVector &Endpoint::mediaEnumPorts() const PJSUA2_THROW(Error) 
    20502060{ 
    20512061    return mediaList; 
    20522062} 
     2063#endif 
    20532064 
    20542065AudioMediaVector2 Endpoint::mediaEnumPorts2() const PJSUA2_THROW(Error) 
     
    20902101void Endpoint::mediaAdd(AudioMedia &media) 
    20912102{ 
     2103#if !DEPRECATED_FOR_TICKET_2232 
    20922104    /* mediaList serves mediaEnumPorts() only, once mediaEnumPorts() 
    20932105     * is removed, this function implementation should be no-op. 
     
    21022114        mediaList.push_back(&media); 
    21032115    pj_mutex_unlock(mediaListMutex); 
     2116#else 
     2117    PJ_UNUSED_ARG(media); 
     2118#endif 
    21042119} 
    21052120 
    21062121void Endpoint::mediaRemove(AudioMedia &media) 
    21072122{ 
     2123#if !DEPRECATED_FOR_TICKET_2232 
    21082124    /* mediaList serves mediaEnumPorts() only, once mediaEnumPorts() 
    21092125     * is removed, this function implementation should be no-op. 
     
    21172133        mediaList.erase(it); 
    21182134    pj_mutex_unlock(mediaListMutex); 
     2135#else 
     2136    PJ_UNUSED_ARG(media); 
     2137#endif 
    21192138} 
    21202139 
     
    21422161 * Codec operations. 
    21432162 */ 
     2163 
     2164#if !DEPRECATED_FOR_TICKET_2232 
    21442165const CodecInfoVector &Endpoint::codecEnum() PJSUA2_THROW(Error) 
    21452166{ 
     
    21522173    return codecInfoList; 
    21532174} 
     2175#endif 
    21542176 
    21552177CodecInfoVector2 Endpoint::codecEnum2() const PJSUA2_THROW(Error) 
     
    22202242} 
    22212243 
     2244#if !DEPRECATED_FOR_TICKET_2232 
    22222245const CodecInfoVector &Endpoint::videoCodecEnum() PJSUA2_THROW(Error) 
    22232246{ 
     
    22322255    return videoCodecInfoList; 
    22332256} 
     2257#endif 
    22342258 
    22352259CodecInfoVector2 Endpoint::videoCodecEnum2() const PJSUA2_THROW(Error) 
Note: See TracChangeset for help on using the changeset viewer.