Fix ASAN error
Some checks failed
Bin2CPP / Clang Format Checks (push) Has been cancelled
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 1m9s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m9s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 43s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 45s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 1m5s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 1m2s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m24s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 1m23s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 1m3s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 1m5s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: OFF) (push) Has been cancelled
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: ON) (push) Has been cancelled
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Has been cancelled
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Has been cancelled
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Has been cancelled
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Has been cancelled
Bin2CPP / Sonarqube (push) Has been cancelled
Conan Packaging / Package Bin2CPP/1.0.0 (push) Has been cancelled

This commit is contained in:
2026-03-29 12:27:44 +02:00
parent 03d633fb04
commit 49a035b160
9 changed files with 24 additions and 16 deletions

View File

@@ -62,18 +62,24 @@ class Log
#define BIN2CPP_LOG_DEBUG(fmt, ...) \
do \
{ \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
{ \
QUILL_LOG_DEBUG(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
{ \
QUILL_LOG_DEBUG(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
} \
} \
} while (0)
#define BIN2CPP_LOG_TRACE(fmt, ...) \
do \
{ \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
if (Bin2CPP::Singleton<Bin2CPP::Log>::HasInstance()) \
{ \
QUILL_LOG_TRACE_L3(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
if (quill::Logger* logger = Bin2CPP::Singleton<Bin2CPP::Log>::Instance().GetLogger()) \
{ \
QUILL_LOG_TRACE_L3(logger, fmt __VA_OPT__(, ) __VA_ARGS__); \
} \
} \
} while (0)

View File

@@ -39,6 +39,8 @@ void Log::Flush()
Log::~Log()
{
Flush();
for (quill::Logger* logger: quill::Frontend::get_all_loggers())
{
quill::Frontend::remove_logger(logger);