diff options
| author | void_17 <61356189+void2012@users.noreply.github.com> | 2026-03-02 01:28:47 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-02 01:28:47 +0700 |
| commit | 99a8c53bc1f84042e682a67abbd3f49d4b94dba8 (patch) | |
| tree | 6259d92e3482af0151ff69e80bc2c33b530d698a | |
| parent | 3bf5db95841e950c0d4424f542a692fcd8b29642 (diff) | |
| parent | 3db164d913a0e6e464cc9f32c6c471cbea7a46e7 (diff) | |
Merge pull request #33 from APAmk2/main
Windows: More proper shutdown
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_App.cpp | 4 | ||||
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_App.h | 2 | ||||
| -rw-r--r-- | Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index a8b2d9cc..bba33cad 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -14,6 +14,7 @@ CConsoleMinecraftApp app; CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() { + m_bShutdown = false; } void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) @@ -26,8 +27,7 @@ void CConsoleMinecraftApp::StoreLaunchData() } void CConsoleMinecraftApp::ExitGame() { - // This is likely not the correct way to exit the game, but it will do for now - ExitProcess(0); + m_bShutdown = true; } void CConsoleMinecraftApp::FatalLoadError() { diff --git a/Minecraft.Client/Windows64/Windows64_App.h b/Minecraft.Client/Windows64/Windows64_App.h index 39351d55..de8f6d85 100644 --- a/Minecraft.Client/Windows64/Windows64_App.h +++ b/Minecraft.Client/Windows64/Windows64_App.h @@ -29,6 +29,8 @@ public: // original code virtual void TemporaryCreateGameStart(); + + bool m_bShutdown; }; extern CConsoleMinecraftApp app; diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 931e7f17..1bffe317 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -1034,7 +1034,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } #endif MSG msg = {0}; - while( WM_QUIT != msg.message ) + while( WM_QUIT != msg.message && !app.m_bShutdown) { if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { |
