Merge pull request #33 from APAmk2/main

Windows: More proper shutdown
This commit is contained in:
void_17
2026-03-02 01:28:47 +07:00
committed by GitHub
3 changed files with 5 additions and 3 deletions

View File

@@ -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()
{

View File

@@ -29,6 +29,8 @@ public:
// original code
virtual void TemporaryCreateGameStart();
bool m_bShutdown;
};
extern CConsoleMinecraftApp app;

View File

@@ -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 ) )
{