diff --git a/src/timers.c b/src/timers.c index 872a21b..8cb57b3 100644 --- a/src/timers.c +++ b/src/timers.c @@ -76,6 +76,8 @@ void uc_timers_remove(struct UCTimers *timers, struct UCTimer *timer) timer->ready_entry.tqe_prev = (struct UCTimer **)105; return; } + assert(timer->state == UC_TIMER_ACTIVE || + timer->state == UC_TIMER_PENDING); uc_rb_remove(&timers->timer_tree, &timer->rb_node); //remove it, safe for the //callback to re_add it