From 8841b7e2d516bcec7a6a27df62952960277488e2 Mon Sep 17 00:00:00 2001 From: lixingcong Date: Tue, 20 Aug 2024 08:21:38 +0800 Subject: [PATCH] Restore init thread-local var in mdc.h, not use reference-init --- include/spdlog/mdc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/mdc.h b/include/spdlog/mdc.h index 7024db04..41f0c1f3 100644 --- a/include/spdlog/mdc.h +++ b/include/spdlog/mdc.h @@ -38,7 +38,7 @@ public: static void clear() { get_context().clear(); } static mdc_map_t &get_context() { - static thread_local mdc_map_t& context = *new mdc_map_t; + static thread_local mdc_map_t context; return context; } };