[Logging]: Fix (#896)

This commit is contained in:
Edo 2023-04-03 13:49:37 +02:00 committed by GitHub
parent daf6da1cfa
commit bacaec491f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ namespace Components
std::mutex Logger::MessageMutex; std::mutex Logger::MessageMutex;
std::vector<std::string> Logger::MessageQueue; std::vector<std::string> Logger::MessageQueue;
std::mutex Logger::LoggingMutex; std::recursive_mutex Logger::LoggingMutex;
std::vector<Network::Address> Logger::LoggingAddresses[2]; std::vector<Network::Address> Logger::LoggingAddresses[2];
Dvar::Var Logger::IW4x_oneLog; Dvar::Var Logger::IW4x_oneLog;
@ -223,7 +223,9 @@ namespace Components
void Logger::RedirectOSPath(const char* file, char* folder) void Logger::RedirectOSPath(const char* file, char* folder)
{ {
if (std::strcmp((*Game::g_log)->current.string, file) == 0) const auto* g_log = (*Game::g_log) ? (*Game::g_log)->current.string : "";
if (std::strcmp(g_log, file) == 0)
{ {
if (std::strcmp(folder, "userraw") != 0) if (std::strcmp(folder, "userraw") != 0)
{ {

View File

@ -111,7 +111,7 @@ namespace Components
static std::mutex MessageMutex; static std::mutex MessageMutex;
static std::vector<std::string> MessageQueue; static std::vector<std::string> MessageQueue;
static std::mutex LoggingMutex; static std::recursive_mutex LoggingMutex;
static std::vector<Network::Address> LoggingAddresses[2]; static std::vector<Network::Address> LoggingAddresses[2];
static Dvar::Var IW4x_oneLog; static Dvar::Var IW4x_oneLog;