diff options
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r-- | lib/libc/stdlib/exit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c index a656e04586c0..521d05a554b1 100644 --- a/lib/libc/stdlib/exit.c +++ b/lib/libc/stdlib/exit.c @@ -63,6 +63,12 @@ exit(int status) _thread_autoinit_dummy_decl = 1; + /* + * We're dealing with cleaning up thread_local destructors in the case of + * the process termination through main() exit. + * Other cases are handled elsewhere. + */ + __cxa_thread_call_dtors(); __cxa_finalize(NULL); if (__cleanup) (*__cleanup)(); |