Skip to content

Commit

Permalink
Fish out next timer before unlinking current
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Oct 6, 2024
1 parent e164a96 commit b8d3ac7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ int timer_clear(int timer_id)
return -1;
}

/* Found it, now unlink it from the queue */
TAILQ_REMOVE(&tl, ptr, link);

/* protect against stopping timers in callbacks */
ptr->act = 0;

Expand All @@ -255,6 +252,9 @@ int timer_clear(int timer_id)
if (next)
next->time += ptr->time;

/* Done manip. next entry, now safe to unlink from active queue */
TAILQ_REMOVE(&tl, ptr, link);

if (ptr->data) {
free(ptr->data);
ptr->data = NULL;
Expand Down

0 comments on commit b8d3ac7

Please sign in to comment.