Ignore:
Timestamp:
Dec 19, 2014 2:22:35 PM (5 years ago)
Author:
nanang
Message:

Fixed #1807: Crash when shutting down library while having subscription transactions on going.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r4747 r4969  
    235235    int                   pending_tsx;  /**< Number of pending transactions.*/ 
    236236    pjsip_transaction    *pending_sub;  /**< Pending UAC SUBSCRIBE tsx.     */ 
     237    pj_timer_entry       *pending_sub_timer; /**< Stop pending sub timer.   */ 
    237238 
    238239    void                 *mod_data[PJSIP_MAX_MODULE];   /**< Module data.   */ 
     
    535536    /* Kill timer */ 
    536537    set_timer(sub, TIMER_TYPE_NONE, 0); 
     538 
     539    /* Kill timer for stopping pending sub (see ticket #1807) */ 
     540    if (sub->pending_sub_timer && sub->pending_sub_timer->id == 1) { 
     541        pjsip_endpt_cancel_timer(sub->endpt, sub->pending_sub_timer); 
     542        sub->pending_sub_timer->id = 0; 
     543        sub->pending_sub_timer = NULL; 
     544    } 
    537545 
    538546    /* Remove this session from dialog's list of subscription */ 
     
    13491357 
    13501358    PJ_UNUSED_ARG(timer_heap); 
     1359 
     1360    /* Clear timer ID */ 
     1361    entry->id = 0; 
    13511362 
    13521363    key = (pj_str_t*)entry->user_data; 
     
    15711582            timer->cb = &terminate_timer_cb; 
    15721583            timer->user_data = key; 
     1584            timer->id = 1; 
     1585            sub->pending_sub_timer = timer; 
    15731586 
    15741587            pjsip_endpt_schedule_timer(dlg->endpt, timer, &timeout); 
Note: See TracChangeset for help on using the changeset viewer.