Changeset 5534


Ignore:
Timestamp:
Jan 19, 2017 7:41:25 AM (8 years ago)
Author:
nanang
Message:

Re #1513: Applied the new API pj_pool_safe_release().

Location:
pjproject/trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/dns_server.c

    r5350 r5534  
    125125    } 
    126126 
    127     if (srv->pool) { 
    128         pj_pool_t *pool = srv->pool; 
    129         srv->pool = NULL; 
    130         pj_pool_release(pool); 
    131     } 
     127    pj_pool_safe_release(&srv->pool); 
    132128 
    133129    return PJ_SUCCESS; 
  • pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c

    r5477 r5534  
    514514    } 
    515515 
    516     if (resolver->pool) { 
    517         pj_pool_t *pool = resolver->pool; 
    518         resolver->pool = NULL; 
    519         pj_pool_release(pool); 
    520     } 
     516    pj_pool_safe_release(&resolver->pool); 
     517 
    521518    return PJ_SUCCESS; 
    522519} 
  • pjproject/trunk/pjlib/include/pj/pool_i.h

    r5533 r5534  
    9898    pj_pool_t *pool = *ppool; 
    9999    *ppool = NULL; 
    100     pj_pool_release(pool); 
     100    if (pool) 
     101        pj_pool_release(pool); 
    101102} 
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/legacy_dev.c

    r3553 r5534  
    142142 
    143143    if (status == PJ_SUCCESS) { 
    144         pj_pool_t *pool = wf->pool; 
    145         wf->pool = NULL; 
    146         pj_pool_release(pool); 
     144        pj_pool_safe_release(&wf->pool); 
    147145    } 
    148146 
     
    456454 
    457455    if (status == PJ_SUCCESS) { 
    458         pj_pool_t *pool = strm->pool; 
    459  
    460         strm->pool = NULL; 
    461         pj_pool_release(pool); 
     456        pj_pool_safe_release(&strm->pool); 
    462457    } 
    463458 
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/null_dev.c

    r3553 r5534  
    161161{ 
    162162    struct null_audio_factory *nf = (struct null_audio_factory*)f; 
    163     pj_pool_t *pool = nf->pool; 
    164  
    165     nf->pool = NULL; 
    166     pj_pool_release(pool); 
     163 
     164    pj_pool_safe_release(&nf->pool); 
    167165 
    168166    return PJ_SUCCESS; 
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/avi_dev.c

    r4537 r5534  
    193193{ 
    194194    struct avi_factory *cf = (struct avi_factory*)f; 
    195     pj_pool_t *pool = cf->pool; 
    196  
    197     cf->pool = NULL; 
    198     pj_pool_release(pool); 
     195 
     196    pj_pool_safe_release(&cf->pool); 
    199197 
    200198    return PJ_SUCCESS; 
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/colorbar_dev.c

    r5050 r5534  
    253253{ 
    254254    struct cbar_factory *cf = (struct cbar_factory*)f; 
    255     pj_pool_t *pool = cf->pool; 
    256  
    257     cf->pool = NULL; 
    258     pj_pool_release(pool); 
     255 
     256    pj_pool_safe_release(&cf->pool); 
    259257 
    260258    return PJ_SUCCESS; 
  • pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c

    r4160 r5534  
    416416    } 
    417417 
    418     if (clock->pool) { 
    419         pj_pool_t *pool = clock->pool; 
    420         clock->pool = NULL; 
    421         pj_pool_release(pool); 
    422     } 
    423     return PJ_SUCCESS; 
    424 } 
    425  
    426  
     418    pj_pool_safe_release(&clock->pool); 
     419 
     420    return PJ_SUCCESS; 
     421} 
     422 
     423 
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r5479 r5534  
    25722572#endif 
    25732573 
    2574     if (stream->own_pool) { 
    2575         pj_pool_t *pool = stream->own_pool; 
    2576         stream->own_pool = NULL; 
    2577         pj_pool_release(pool); 
    2578     } 
     2574    pj_pool_safe_release(&stream->own_pool); 
     2575 
    25792576    return PJ_SUCCESS; 
    25802577} 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c

    r5521 r5534  
    18791879    } 
    18801880 
    1881     if (tp_ice->pool) { 
    1882         pj_pool_t *pool = tp_ice->pool; 
    1883         tp_ice->pool = NULL; 
    1884         pj_pool_release(pool); 
    1885     } 
     1881    pj_pool_safe_release(&tp_ice->pool); 
    18861882 
    18871883    return PJ_SUCCESS; 
  • pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c

    r5516 r5534  
    18051805#endif 
    18061806 
    1807     if (stream->own_pool) { 
    1808         pj_pool_t *pool = stream->own_pool; 
    1809         stream->own_pool = NULL; 
    1810         pj_pool_release(pool); 
    1811     } 
     1807    pj_pool_safe_release(&stream->own_pool); 
    18121808 
    18131809    return PJ_SUCCESS; 
  • pjproject/trunk/pjnath/src/pjnath-test/ice_test.c

    r5387 r5534  
    403403    } 
    404404 
    405     if (sess->pool) { 
    406         pj_pool_t *pool = sess->pool; 
    407         sess->pool = NULL; 
    408         pj_pool_release(pool); 
    409     } 
     405    pj_pool_safe_release(&sess->pool); 
    410406} 
    411407 
  • pjproject/trunk/pjnath/src/pjnath-test/server.c

    r5387 r5534  
    255255    } 
    256256 
    257     if (test_srv->pool) { 
    258         pj_pool_t *pool = test_srv->pool; 
    259         test_srv->pool = NULL; 
    260         pj_pool_release(pool); 
    261     } 
     257    pj_pool_safe_release(&test_srv->pool); 
    262258} 
    263259 
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r5427 r5534  
    462462    pj_ice_sess *ice = (pj_ice_sess*) obj; 
    463463 
    464     if (ice->pool) { 
    465         pj_pool_t *pool = ice->pool; 
    466         ice->pool = NULL; 
    467         pj_pool_release(pool); 
    468     } 
     464    pj_pool_safe_release(&ice->pool); 
     465 
    469466    LOG4((THIS_FILE, "ICE session %p destroyed", ice)); 
    470467} 
  • pjproject/trunk/pjnath/src/pjnath/stun_sock.c

    r5363 r5534  
    475475    */ 
    476476 
    477     if (stun_sock->pool) { 
    478         pj_pool_t *pool = stun_sock->pool; 
    479         stun_sock->pool = NULL; 
    480         pj_pool_release(pool); 
    481     } 
     477    pj_pool_safe_release(&stun_sock->pool); 
    482478 
    483479    TRACE_(("", "STUN sock %p destroyed", stun_sock)); 
  • pjproject/trunk/pjnath/src/pjnath/turn_session.c

    r5481 r5534  
    329329    /* Destroy pool */ 
    330330    if (sess->pool) { 
    331         pj_pool_t *pool = sess->pool; 
    332  
    333331        PJ_LOG(4,(sess->obj_name, "TURN client session destroyed")); 
    334  
    335         sess->pool = NULL; 
    336         pj_pool_release(pool); 
     332        pj_pool_safe_release(&sess->pool); 
    337333    } 
    338334} 
  • pjproject/trunk/pjnath/src/pjnath/turn_sock.c

    r5521 r5534  
    218218 
    219219    if (turn_sock->pool) { 
    220         pj_pool_t *pool = turn_sock->pool; 
    221220        PJ_LOG(4,(turn_sock->obj_name, "TURN socket destroyed")); 
    222         turn_sock->pool = NULL; 
    223         pj_pool_release(pool); 
     221        pj_pool_safe_release(&turn_sock->pool); 
    224222    } 
    225223} 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r5308 r5534  
    20112011    } 
    20122012 
    2013     if (app_config.pool) { 
    2014         pj_pool_release(app_config.pool); 
    2015         app_config.pool = NULL; 
    2016     } 
     2013    pj_pool_safe_release(&app_config.pool); 
    20172014 
    20182015    status = pjsua_destroy(); 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r5325 r5534  
    567567 
    568568    if (listener->factory.pool) { 
    569         pj_pool_t *pool = listener->factory.pool; 
    570  
    571569        PJ_LOG(4,(listener->factory.obj_name,  "SIP TCP transport destroyed")); 
    572  
    573         listener->factory.pool = NULL; 
    574         pj_pool_release(pool); 
     570        pj_pool_safe_release(&listener->factory.pool); 
    575571    } 
    576572} 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c

    r5472 r5534  
    604604 
    605605    if (listener->factory.pool) { 
    606         pj_pool_t *pool = listener->factory.pool; 
    607  
    608606        PJ_LOG(4,(listener->factory.obj_name,  "SIP TLS transport destroyed")); 
    609  
    610         listener->factory.pool = NULL; 
    611         pj_pool_release(pool); 
     607        pj_pool_safe_release(&listener->factory.pool); 
    612608    } 
    613609} 
Note: See TracChangeset for help on using the changeset viewer.