diff --git a/src/kernel/libroot/posix/stdlib/exit.c b/src/kernel/libroot/posix/stdlib/exit.c index 1264406755..d6eb2b06ec 100644 --- a/src/kernel/libroot/posix/stdlib/exit.c +++ b/src/kernel/libroot/posix/stdlib/exit.c @@ -23,6 +23,7 @@ // ToDo: move this puppy to a more standard location #include "../stdio/local.h" +extern void _thread_do_exit_notification(void); static void (*_Exit_Stack[ATEXIT_MAX])(void) = {0}; @@ -54,7 +55,10 @@ atexit(void (*func)(void)) void exit(int status) -{ +{ + // BeOS on exit notification for the main thread + _thread_do_exit_notification(); + // unwind the exit stack, calling the registered functions while (_Exit_SP > 0) (*_Exit_Stack[--_Exit_SP])();