Changeset 3077


Ignore:
Timestamp:
Jan 27, 2010 9:09:27 AM (14 years ago)
Author:
bennylp
Message:

Fixed ticket #1036: Stray timer may be registered by SIP TCP and TLS transport in destroy routine, which could crash the program on Symbian (thanks Tamàs Solymosi for the report)

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r3071 r3077  
    710710    pj_bool_t               tracing;        /**< Tracing enabled?           */ 
    711711    pj_bool_t               is_shutdown;    /**< Being shutdown?            */ 
     712    pj_bool_t               is_destroying;  /**< Destroy in progress?       */ 
    712713 
    713714    /** Key for indexing this transport in hash table. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r2915 r3077  
    817817    if (pj_atomic_dec_and_get(tp->ref_cnt) == 0) { 
    818818        pj_lock_acquire(tp->tpmgr->lock); 
    819         /* Verify again. */ 
    820         if (pj_atomic_get(tp->ref_cnt) == 0) { 
     819        /* Verify again. Do not register timer if the transport is 
     820         * being destroyed. 
     821         */ 
     822        if (pj_atomic_get(tp->ref_cnt) == 0 && !tp->is_destroying) { 
    821823            pj_time_val delay; 
    822824             
     
    898900    pj_lock_acquire(tp->lock); 
    899901    pj_lock_acquire(mgr->lock); 
     902 
     903    tp->is_destroying = PJ_TRUE; 
    900904 
    901905    /* 
Note: See TracChangeset for help on using the changeset viewer.