mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 12:05:38 +00:00
(Windows) Fixed an issue with a potentially unclean application shutdown.
This commit is contained in:
parent
86de74931a
commit
9b6789529b
|
@ -120,18 +120,6 @@ win64ConsoleType outputToConsole(bool allocConsole)
|
|||
|
||||
return consoleType;
|
||||
}
|
||||
|
||||
void closeConsole()
|
||||
{
|
||||
FILE* fp;
|
||||
|
||||
// Redirect stdin, stdout and stderr to NUL.
|
||||
freopen_s(&fp, "NUL:", "r", stdin);
|
||||
freopen_s(&fp, "NUL:", "w", stdout);
|
||||
freopen_s(&fp, "NUL:", "w", stderr);
|
||||
|
||||
FreeConsole();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool parseArgs(int argc, char* argv[])
|
||||
|
@ -399,7 +387,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
if (!parseArgs(argc, argv)) {
|
||||
#if defined(_WIN64)
|
||||
closeConsole();
|
||||
FreeConsole();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -661,7 +649,7 @@ int main(int argc, char* argv[])
|
|||
LOG(LogInfo) << "EmulationStation cleanly shutting down";
|
||||
|
||||
#if defined(_WIN64)
|
||||
closeConsole();
|
||||
FreeConsole();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue