From d274ff862735ed7f55e511d3d0a8affe4079545e Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 5 Dec 2025 09:45:47 +0000 Subject: [PATCH] Delete prefix strings on shutdown to avoid triggering leak warnings. Fixes #5532 --- kernel/yosys_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/yosys_common.h b/kernel/yosys_common.h index 55e7b71eb..47dae5473 100644 --- a/kernel/yosys_common.h +++ b/kernel/yosys_common.h @@ -299,8 +299,8 @@ RTLIL::IdString new_id_suffix(std::string_view file, int line, std::string_view #define NEW_ID \ YOSYS_NAMESPACE_PREFIX RTLIL::IdString::new_autoidx_with_prefix([](std::string_view func) -> const std::string * { \ - static const std::string *prefix = YOSYS_NAMESPACE_PREFIX create_id_prefix(__FILE__, __LINE__, func); \ - return prefix; \ + static std::unique_ptr prefix(YOSYS_NAMESPACE_PREFIX create_id_prefix(__FILE__, __LINE__, func)); \ + return prefix.get(); \ }(__FUNCTION__)) #define NEW_ID_SUFFIX(suffix) \ YOSYS_NAMESPACE_PREFIX new_id_suffix(__FILE__, __LINE__, __FUNCTION__, suffix)