From 66f27005ec1a3e1fa78733aad56dcd976fbb2744 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sun, 11 Sep 2022 22:26:24 +0200 Subject: Cancelling all timers when loop stops --- sysdep/unix/io-loop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sysdep/unix/io-loop.c') diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 3e3fc31a..b7c858c6 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -560,8 +560,11 @@ birdloop_main(void *arg) /* Flush remaining events */ ASSERT_DIE(!ev_run_list(&loop->event_list)); - /* No timers allowed */ - ASSERT_DIE(timers_count(&loop->time) == 0); + /* Drop timers */ + while (t = timers_first(&loop->time)) + tm_stop(t); + + /* No sockets allowed */ ASSERT_DIE(EMPTY_LIST(loop->sock_list)); ASSERT_DIE(loop->sock_num == 0); -- cgit v1.2.3