Skip to content

Commit d5cc09f

Browse files
committed
Fix exception when ending debugging app from within Visual Studio.
1 parent d940c58 commit d5cc09f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

logging.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "executable.h"
1212
#include "string_utils.h"
1313

14-
HANDLE g_logFileHandle = NULL;
14+
HANDLE g_logFileHandle = nullptr;
1515

1616
void InitializeLogging(bool show_console, std::string log_level,
1717
std::string log_file) {
@@ -51,7 +51,7 @@ void InitializeLogging(bool show_console, std::string log_level,
5151
FILE_ATTRIBUTE_NORMAL,
5252
NULL);
5353
if (g_logFileHandle == INVALID_HANDLE_VALUE) {
54-
g_logFileHandle = NULL;
54+
g_logFileHandle = nullptr;
5555
LOGGER_ERROR << "Opening log file for appending failed";
5656
return;
5757
}
@@ -74,6 +74,8 @@ void InitializeLogging(bool show_console, std::string log_level,
7474
}
7575
void ShutdownLogging() {
7676
if (g_logFileHandle) {
77-
CloseHandle(g_logFileHandle);
77+
// Throws exception. CEF also has access to that file and it does something with the handle.
78+
// CloseHandle(g_logFileHandle);
79+
g_logFileHandle = nullptr;
7880
}
7981
}

0 commit comments

Comments
 (0)