Merge pull request #18182 from hrydgard/change-backend-exit-fix

Backend change from Win32 menu: Add quick workaround for instance counter misbehavior
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-09-20 19:32:47 +02:00
commit dee84e6810
1 file changed
+7
+7
View File
@@ -822,6 +822,13 @@ static void WinMainCleanup() {
CoUninitialize();
if (g_Config.bRestartRequired) {
// TODO: ExitAndRestart prevents the Config::~Config destructor from running,
// which normally would have done this instance counter update.
// ExitAndRestart calls ExitProcess which really bad, we should do something better that
// allows us to fall out of main() properly.
if (g_Config.bUpdatedInstanceCounter) {
ShutdownInstanceCounter();
}
W32Util::ExitAndRestart(!restartArgs.empty(), restartArgs);
}
}