Skip to content

Commit 552f67b

Browse files
committed
CONSOLE: Show error if module calls exit()
1 parent 683366e commit 552f67b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/platform/console/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ bool wait_for_file(const char *file, uint32_t modifiedTime) {
398398
}
399399
#endif
400400

401+
static void exit_handler(void) {
402+
if (count_tasks()) {
403+
err_stackunderflow();
404+
}
405+
}
406+
401407
//
402408
// program entry point
403409
//
@@ -416,6 +422,7 @@ int main(int argc, char *argv[]) {
416422
os_graphics = 1;
417423

418424
console_init();
425+
atexit(exit_handler);
419426

420427
char *file = nullptr;
421428
bool tmpFile = false;

0 commit comments

Comments
 (0)