Browse Source

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

reviewable/pr5731/r1
Anthony Bilinski 6 years ago
parent
commit
fae9066be6
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 6
      src/main.cpp

6
src/main.cpp

@ -75,8 +75,10 @@ void cleanup() @@ -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
}

Loading…
Cancel
Save