Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(log): don't attempt to close log file if it failed to open on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonybilinski committed Jun 28, 2019
1 parent 17083b5 commit fae9066
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit fae9066

Please sign in to comment.