diff --git a/Src/OSD/Logger.cpp b/Src/OSD/Logger.cpp index ad7aa48..4e63e6e 100644 --- a/Src/OSD/Logger.cpp +++ b/Src/OSD/Logger.cpp @@ -168,7 +168,10 @@ void CMultiLogger::DebugLog(const char *fmt, va_list vl) { for (auto &logger: m_loggers) { - logger->DebugLog(fmt, vl); + va_list vl_tmp; + va_copy(vl_tmp, vl); + logger->DebugLog(fmt, vl_tmp); + va_end(vl_tmp); } } @@ -176,7 +179,10 @@ void CMultiLogger::InfoLog(const char *fmt, va_list vl) { for (auto &logger: m_loggers) { - logger->InfoLog(fmt, vl); + va_list vl_tmp; + va_copy(vl_tmp, vl); + logger->InfoLog(fmt, vl_tmp); + va_end(vl_tmp); } } @@ -184,7 +190,10 @@ void CMultiLogger::ErrorLog(const char *fmt, va_list vl) { for (auto &logger: m_loggers) { - logger->ErrorLog(fmt, vl); + va_list vl_tmp; + va_copy(vl_tmp, vl); + logger->ErrorLog(fmt, vl_tmp); + va_end(vl_tmp); } } @@ -391,4 +400,4 @@ void CSystemLogger::ErrorLog(const char *fmt, va_list vl) CSystemLogger::CSystemLogger(CLogger::LogLevel level) : m_logLevel(level) { -} \ No newline at end of file +}