From b110c55993b44409af872ed5fa28c40e36b1af16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Boro=C5=84ski?= <94375110+kboronski-ant@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:39:06 +0100 Subject: [PATCH] Fix a memory leak in V3Fork (#4628) --- src/V3Fork.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index a271874ae..133e4352f 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -445,7 +445,11 @@ public: if (typesAdded) v3Global.rootp()->typeTablep()->repairCache(); } - ~DynScopeVisitor() override = default; + ~DynScopeVisitor() override { + std::set frames; + for (auto node_frame : m_frames) { frames.insert(node_frame.second); } + for (auto* frame : frames) { delete frame; } + } }; //######################################################################