diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 098104d111..bd52f90a1c 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -441,7 +441,15 @@ class DynScopeVisitor final : public VNVisitor { 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; + } + } }; //######################################################################