Ignore:
Timestamp:
Apr 11, 2012 9:41:25 AM (8 years ago)
Author:
bennylp
Message:

More re #1481: Destroying the regc may lead to dangling binding in the register, so instead of destroying the regc, instruct it to release the transport instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_reg.c

    r3553 r4037  
    441441} 
    442442 
     443/* Release transport */ 
     444PJ_DEF(pj_status_t) pjsip_regc_release_transport(pjsip_regc *regc) 
     445{ 
     446    PJ_ASSERT_RETURN(regc, PJ_EINVAL); 
     447    if (regc->last_transport) { 
     448        pjsip_transport_dec_ref(regc->last_transport); 
     449        regc->last_transport = NULL; 
     450    } 
     451    return PJ_SUCCESS; 
     452} 
     453 
    443454 
    444455PJ_DEF(pj_status_t) pjsip_regc_add_headers( pjsip_regc *regc, 
     
    12701281 
    12711282    /* Get last transport used and add reference to it */ 
    1272     if (tdata->tp_info.transport != regc->last_transport) { 
     1283    if (tdata->tp_info.transport != regc->last_transport && 
     1284        status==PJ_SUCCESS) 
     1285    { 
    12731286        if (regc->last_transport) { 
    12741287            pjsip_transport_dec_ref(regc->last_transport); 
Note: See TracChangeset for help on using the changeset viewer.