Skip to content

Commit 3cf8d80

Browse files
committed
Don't assert in Log::printf if file handle closed
Fixes #17 - log.cpp line 166 filehandle_ != INVALID_HANDLE_VALUE
1 parent 2ce685a commit 3cf8d80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Log.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ void print(Level level, const char * str)
162162
return;
163163
}
164164

165-
if (enableLogging_) {
166-
assert(fileHandle_ != INVALID_HANDLE_VALUE);
165+
if (enableLogging_ && (fileHandle_ != INVALID_HANDLE_VALUE)) {
167166
DWORD bytesWritten = 0;
168167
WriteFile(fileHandle_, line.c_str(), (DWORD)line.size(), &bytesWritten, nullptr);
169168
assert(bytesWritten == line.size());

0 commit comments

Comments
 (0)