diff options
Diffstat (limited to 'pjlib/src/pj/timer.c')
-rw-r--r-- | pjlib/src/pj/timer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c index 931a57fa..225be449 100644 --- a/pjlib/src/pj/timer.c +++ b/pjlib/src/pj/timer.c @@ -328,18 +328,23 @@ static int cancel( pj_timer_heap_t *ht, PJ_CHECK_STACK(); // Check to see if the timer_id is out of range - if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) + if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) { + entry->_timer_id = -1; return 0; + } timer_node_slot = ht->timer_ids[entry->_timer_id]; - if (timer_node_slot < 0) // Check to see if timer_id is still valid. + if (timer_node_slot < 0) { // Check to see if timer_id is still valid. + entry->_timer_id = -1; return 0; + } if (entry != ht->heap[timer_node_slot]) { if ((flags & F_DONT_ASSERT) == 0) pj_assert(entry == ht->heap[timer_node_slot]); + entry->_timer_id = -1; return 0; } else |