1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(log): don't attempt to close log file if it failed to open on exit

This commit is contained in:
Anthony Bilinski 2019-06-28 01:41:36 -07:00
parent 17083b50ba
commit fae9066be6
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -75,8 +75,10 @@ void cleanup()
#ifdef LOG_TO_FILE
FILE* f = logFileFile.load();
fclose(f);
logFileFile.store(nullptr); // atomically disable logging to file
if (f != nullptr) {
fclose(f);
logFileFile.store(nullptr); // atomically disable logging to file
}
#endif
}