From 3d11a9b17f0de9727c63e3190f3fddc29c67d21c Mon Sep 17 00:00:00 2001 From: "Nakasaka, Masato" Date: Fri, 24 Apr 2026 17:23:08 +0900 Subject: [PATCH] Stopped using static vector Using std::vector will cause g_col to be released before the logger thread exits, causing the logger thread to touch freed memory causing a crash --- common/log.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/log.cpp b/common/log.cpp index de2dbeccaa..52f070961d 100644 --- a/common/log.cpp +++ b/common/log.cpp @@ -49,7 +49,7 @@ enum common_log_col : int { }; // disable colors by default -static std::vector g_col = { +static const char* g_col[] = { "", "", "", @@ -338,7 +338,7 @@ public: g_col[COMMON_LOG_COL_CYAN] = LOG_COL_CYAN; g_col[COMMON_LOG_COL_WHITE] = LOG_COL_WHITE; } else { - for (size_t i = 0; i < g_col.size(); i++) { + for (size_t i = 0; i < std::size(g_col); i++) { g_col[i] = ""; } }