Skip to content

Commit

Permalink
Stop timers from spinning after they've been freed
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Dec 22, 2019
1 parent 9b9ff19 commit ecd2e94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void *timer_thread(void *param) {
}
if (timer->running)
timer->callback(timer->data);
if (timespec_positive(timer->interval)) {
if (timer->running && timespec_positive(timer->interval)) {
timer->start = timer->end;
timer->end = timespec_add(timer->start, timer->interval);
} else {
Expand Down

0 comments on commit ecd2e94

Please sign in to comment.