From: Maria Matejka Date: Sun, 11 Sep 2022 20:26:24 +0000 (+0200) Subject: Cancelling all timers when loop stops X-Git-Tag: v3.0-alpha1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66f27005ec1a3e1fa78733aad56dcd976fbb2744;p=thirdparty%2Fbird.git Cancelling all timers when loop stops --- diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 3e3fc31af..b7c858c6e 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);