Changeset 4855


Ignore:
Timestamp:
Jun 4, 2014 9:23:10 AM (10 years ago)
Author:
bennylp
Message:

Misc (re #1751): invalidate timer entry for every cancel() scenario to avoid assertion next time the entry is scheduled if cancellation fails (thanks Johan Lantz for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/timer.c

    r4567 r4855  
    329329 
    330330  // Check to see if the timer_id is out of range 
    331   if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) 
     331  if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) { 
     332    entry->_timer_id = -1; 
    332333    return 0; 
     334  } 
    333335 
    334336  timer_node_slot = ht->timer_ids[entry->_timer_id]; 
    335337 
    336   if (timer_node_slot < 0) // Check to see if timer_id is still valid. 
     338  if (timer_node_slot < 0) { // Check to see if timer_id is still valid. 
     339    entry->_timer_id = -1; 
    337340    return 0; 
     341  } 
    338342 
    339343  if (entry != ht->heap[timer_node_slot]) 
     
    341345      if ((flags & F_DONT_ASSERT) == 0) 
    342346          pj_assert(entry == ht->heap[timer_node_slot]); 
     347      entry->_timer_id = -1; 
    343348      return 0; 
    344349    } 
Note: See TracChangeset for help on using the changeset viewer.