Fix a memory leak in V3Fork (#4628)

This commit is contained in:
Krzysztof Boroński 2023-11-05 17:39:06 +01:00 committed by GitHub
parent dc346b7ffa
commit b110c55993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -445,7 +445,11 @@ public:
if (typesAdded) v3Global.rootp()->typeTablep()->repairCache();
}
~DynScopeVisitor() override = default;
~DynScopeVisitor() override {
std::set<ForkDynScopeFrame*> frames;
for (auto node_frame : m_frames) { frames.insert(node_frame.second); }
for (auto* frame : frames) { delete frame; }
}
};
//######################################################################