Changeset 4987 for pjproject/trunk


Ignore:
Timestamp:
Mar 3, 2015 2:41:27 AM (10 years ago)
Author:
ming
Message:

Fixed #1818: Fixed destruction of locked mutex (thanks to Denis Poltorak for the Helgrind report)

Location:
pjproject/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c

    r4537 r4987  
    881881 
    882882    /* Destroy mutex. */ 
     883    pj_mutex_unlock(ffmpeg_factory.mutex); 
    883884    pj_mutex_destroy(ffmpeg_factory.mutex); 
     885    ffmpeg_factory.mutex = NULL; 
    884886 
    885887    /* Destroy pool. */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c

    r4931 r4987  
    470470        pj_pool_release(codec_factory.pool); 
    471471        codec_factory.pool = NULL; 
     472        pj_mutex_unlock(codec_factory.mutex); 
    472473        return PJ_EINVALIDOP; 
    473474    } 
     
    478479     
    479480    /* Destroy mutex. */ 
     481    pj_mutex_unlock(codec_factory.mutex); 
    480482    pj_mutex_destroy(codec_factory.mutex); 
     483    codec_factory.mutex = NULL; 
    481484 
    482485    /* Destroy pool. */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c

    r4002 r4987  
    767767        pj_pool_release(ipp_factory.pool); 
    768768        ipp_factory.pool = NULL; 
     769        pj_mutex_unlock(ipp_factory.mutex); 
    769770        return PJ_EINVALIDOP; 
    770771    } 
     
    775776     
    776777    /* Destroy mutex. */ 
     778    pj_mutex_unlock(ipp_factory.mutex); 
    777779    pj_mutex_destroy(ipp_factory.mutex); 
     780    ipp_factory.mutex = NULL; 
    778781 
    779782    /* Destroy pool. */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c

    r4621 r4987  
    230230 
    231231    /* Destroy mutex. */ 
     232    pj_mutex_unlock(l16_factory.mutex); 
    232233    pj_mutex_destroy(l16_factory.mutex); 
    233234    l16_factory.mutex = NULL; 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c

    r4886 r4987  
    448448        pj_pool_release(codec_factory.pool); 
    449449        codec_factory.pool = NULL; 
     450        pj_mutex_unlock(codec_factory.mutex); 
    450451        return PJ_EINVALIDOP; 
    451452    } 
     
    456457     
    457458    /* Destroy mutex. */ 
     459    pj_mutex_unlock(codec_factory.mutex); 
    458460    pj_mutex_destroy(codec_factory.mutex); 
     461    codec_factory.mutex = NULL; 
    459462 
    460463    /* Destroy pool. */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c

    r4339 r4987  
    367367 
    368368    /* Destroy mutex. */ 
     369    pj_mutex_unlock(silk_factory.mutex); 
    369370    pj_mutex_destroy(silk_factory.mutex); 
    370371    silk_factory.mutex = NULL; 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c

    r4713 r4987  
    388388     
    389389    /* Destroy mutex. */ 
     390    pj_mutex_unlock(spx_factory.mutex); 
    390391    pj_mutex_destroy(spx_factory.mutex); 
     392    spx_factory.mutex = NULL; 
    391393 
    392394    /* Destroy pool. */ 
  • pjproject/trunk/pjmedia/src/pjmedia/g711.c

    r4537 r4987  
    222222 
    223223    /* Destroy mutex. */ 
     224    pj_mutex_unlock(g711_factory.mutex); 
    224225    pj_mutex_destroy(g711_factory.mutex); 
    225226    g711_factory.mutex = NULL; 
  • pjproject/trunk/pjnath/src/pjturn-srv/allocation.c

    r4728 r4987  
    12831283 
    12841284        /* Register to hash table */ 
    1285         pj_assert(sizeof(p2->channel==2)); 
     1285        pj_assert(sizeof(p2->channel)==2); 
    12861286        pj_hash_set(alloc->pool, alloc->ch_table, &p2->channel, 
    12871287                    sizeof(p2->channel), 0, p2); 
Note: See TracChangeset for help on using the changeset viewer.