Fix nullptr access on dbg_assert with no global logger

Now it's also possible to use `dbg_assert` without/before having set a global logger.
This commit is contained in:
Robert Müller 2023-11-16 21:11:06 +01:00
parent 4e27299657
commit 7d69016b3a

View file

@ -36,7 +36,9 @@ void log_set_global_logger(ILogger *logger)
void log_global_logger_finish() void log_global_logger_finish()
{ {
global_logger.load(std::memory_order_acquire)->GlobalFinish(); ILogger *logger = global_logger.load(std::memory_order_acquire);
if(logger)
logger->GlobalFinish();
} }
void log_set_global_logger_default() void log_set_global_logger_default()