From af338d77ee7f6469530233a70ccb450171ec5c66 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 23 Jun 2021 22:05:11 +0200 Subject: Started widgets and layout stuff --- libs/libc/sys.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/libc') diff --git a/libs/libc/sys.c b/libs/libc/sys.c index b00bd32..c6b7fa3 100644 --- a/libs/libc/sys.c +++ b/libs/libc/sys.c @@ -189,12 +189,20 @@ static void atexit_trigger(void) if (!slot) return; + static u8 cnt = 0; + if (cnt++ != 0) { + log("Couldn't execute all atexit routines\n"); + return; + } + while (slot-- > 0) { if (funcs[slot]) { funcs[slot](); funcs[slot] = NULL; } } + + cnt = 0; } void atexit(void (*func)(void)) -- cgit v1.2.3