Always flush log file on close to prevent incomplete logs

This commit is contained in:
Phillip Stephens 2022-01-10 23:27:06 -08:00
parent 9420e3007e
commit 6926b6a7c9
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 1 additions and 0 deletions

View File

@ -760,6 +760,7 @@ struct FileLogger : public ILogger {
} }
virtual void closeFile() { virtual void closeFile() {
if (fp) { if (fp) {
std::fflush(fp);
std::fclose(fp); std::fclose(fp);
fp = nullptr; fp = nullptr;
} }