diff options
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 7bc2d78ab..24a06c10d 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -141,6 +141,8 @@ int wmain(int argc, wchar_t** argv) { | |||
| 141 | std::fflush(stderr); | 141 | std::fflush(stderr); |
| 142 | // Not `return`: a normal host exit runs the CRT's atexit table, which the game shares with gta6rt (its | 142 | // Not `return`: a normal host exit runs the CRT's atexit table, which the game shares with gta6rt (its |
| 143 | // handlers would run against a game that has stopped) and whose last word decides the exit status. | 143 | // handlers would run against a game that has stopped) and whose last word decides the exit status. |
| 144 | // ExitProcess also skips atexit, so the TLS clone cleanup registered there is run here instead. | ||
| 145 | rt::cleanup_tls_clones(); | ||
| 144 | ExitProcess(static_cast<UINT>(code)); | 146 | ExitProcess(static_cast<UINT>(code)); |
| 145 | } catch (const std::exception& e) { | 147 | } catch (const std::exception& e) { |
| 146 | std::fprintf(stderr, "error: %s\n", e.what()); | 148 | std::fprintf(stderr, "error: %s\n", e.what()); |