Changeset 4092


Ignore:
Timestamp:
Apr 26, 2012 9:24:50 AM (12 years ago)
Author:
bennylp
Message:

Indirectly related to re #1465: acquire transport reference when invoking transport send(), to prevent transport from being destroyed accidently while sending is in progress, and also to reset the idle timer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsip/sip_transport.c

    r4032 r4092  
    660660    } 
    661661 
     662    /* Add reference to prevent deletion, and to cancel idle timer if 
     663     * it's running. 
     664     */ 
     665    pjsip_transport_add_ref(tr); 
     666 
    662667    /* Fill in tp_info. */ 
    663668    tdata->tp_info.transport = tr; 
     
    677682    if (tr->tpmgr->on_tx_msg) { 
    678683        status = (*tr->tpmgr->on_tx_msg)(tr->endpt, tdata); 
    679         if (status != PJ_SUCCESS) 
     684        if (status != PJ_SUCCESS) { 
     685            pjsip_transport_dec_ref(tr); 
    680686            return status; 
     687        } 
    681688    } 
    682689 
     
    700707    } 
    701708 
     709    pjsip_transport_dec_ref(tr); 
    702710    return status; 
    703711} 
Note: See TracChangeset for help on using the changeset viewer.