Skip to content

Commit 0f322b7

Browse files
pi-anlandrewleech
authored andcommitted
unix/main.c: Integrate atexit to be run at the start of exit process.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 1759e0c commit 0f322b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/unix/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,11 @@ MP_NOINLINE int main_(int argc, char **argv) {
748748
}
749749
}
750750

751+
#if MICROPY_PY_ATEXIT
752+
int atexit_code = mp_atexit_execute();
753+
ret = (atexit_code != 0) ? atexit_code : ret;
754+
#endif
755+
751756
#if MICROPY_PY_SYS_SETTRACE
752757
MP_STATE_THREAD(prof_trace_callback) = MP_OBJ_NULL;
753758
#endif

0 commit comments

Comments
 (0)