From 8ef9c6fc5bcfe1b606229a8da024f76b2d5048c1 Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 20 Aug 2016 12:26:44 +0000 Subject: MFC r303795: Add __cxa_thread_atexit(3) API implementation. --- lib/libc/stdlib/exit.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libc/stdlib/exit.c') diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c index 145eb9d..b8afede 100644 --- a/lib/libc/stdlib/exit.c +++ b/lib/libc/stdlib/exit.c @@ -64,6 +64,12 @@ exit(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)(); -- cgit v1.1