diff options
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index fc73f37f5..81d2e208a 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <vector> | 17 | #include <vector> |
| 18 | 18 | ||
| 19 | #include "../shims/shims.h" | 19 | #include "../shims/shims.h" |
| 20 | #include "../shims/process_shim.h" | ||
| 20 | #include "../shims/startup_trace.h" | 21 | #include "../shims/startup_trace.h" |
| 21 | #include "base_reservation.h" | 22 | #include "base_reservation.h" |
| 22 | #include "clzero_patch.h" | 23 | #include "clzero_patch.h" |
| @@ -1198,6 +1199,15 @@ void __cdecl on_host_thread_event(DWORD reason) { | |||
| 1198 | std::fprintf(stderr, "[rt] loader: thread detach, slot %zu (%s): %s\n", i, m->name.c_str(), | 1199 | std::fprintf(stderr, "[rt] loader: thread detach, slot %zu (%s): %s\n", i, m->name.c_str(), |
| 1199 | e.what()); | 1200 | e.what()); |
| 1200 | } | 1201 | } |
| 1202 | if (i == kMainImageSlot) { | ||
| 1203 | try { | ||
| 1204 | process::run_thread_local_exe_atexit_callback(); | ||
| 1205 | } catch (const std::exception& e) { | ||
| 1206 | std::fprintf(stderr, "[rt] loader: executable thread-local destructors: %s\n", e.what()); | ||
| 1207 | } catch (...) { | ||
| 1208 | std::fprintf(stderr, "[rt] loader: executable thread-local destructors threw an unknown exception\n"); | ||
| 1209 | } | ||
| 1210 | } | ||
| 1201 | // Released even when the callbacks threw: a leaked block would be handed to the OS loader as the | 1211 | // Released even when the callbacks threw: a leaked block would be handed to the OS loader as the |
| 1202 | // helper's own TLS block and freed with it at thread exit. | 1212 | // helper's own TLS block and freed with it at thread exit. |
| 1203 | uninstall_thread_block(*m); | 1213 | uninstall_thread_block(*m); |