mirror of https://github.com/PCSX2/pcsx2.git
GSRunner: Fix log file writing
Wasn't getting flushed/closed on shutdown.
This commit is contained in:
parent
338a2beaf0
commit
90a6088d61
|
@ -644,6 +644,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
VMManager::Internal::CPUThreadShutdown();
|
||||
GSRunner::DestroyPlatformWindow();
|
||||
LogSink::CloseFileLog();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1837,11 +1837,7 @@ int main(int argc, char* argv[])
|
|||
s_base_settings_interface->Save();
|
||||
|
||||
// Ensure emulog is flushed.
|
||||
if (emuLog)
|
||||
{
|
||||
std::fclose(emuLog);
|
||||
emuLog = nullptr;
|
||||
}
|
||||
LogSink::CloseFileLog();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -383,6 +383,15 @@ void LogSink::SetFileLogPath(std::string path)
|
|||
}
|
||||
}
|
||||
|
||||
void LogSink::CloseFileLog()
|
||||
{
|
||||
if (!emuLog)
|
||||
return;
|
||||
|
||||
std::fclose(emuLog);
|
||||
emuLog = nullptr;
|
||||
}
|
||||
|
||||
void LogSink::SetBlockSystemConsole(bool block)
|
||||
{
|
||||
s_block_system_console = block;
|
||||
|
|
|
@ -22,6 +22,9 @@ namespace LogSink
|
|||
/// Overrides the filename used for the file log.
|
||||
void SetFileLogPath(std::string path);
|
||||
|
||||
/// Ensures file log is flushed and closed.
|
||||
void CloseFileLog();
|
||||
|
||||
/// Prevents the system console from being displayed.
|
||||
void SetBlockSystemConsole(bool block);
|
||||
|
||||
|
|
Loading…
Reference in New Issue