From c01e2dcfec0d7329cfe1cd2d2c4d9ce83fed1602 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 28 Jan 2022 17:07:11 -0800 Subject: [PATCH] Fix large memory leak in DRC All elements get effective shapes, many of which get triangulated. This memory needs to be freed when destroying the tree (cherry picked from commit c2707f3cc0f24522d62f379c8ff4ed0512eff8e2) --- pcbnew/drc/drc_rtree.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcbnew/drc/drc_rtree.h b/pcbnew/drc/drc_rtree.h index 9918a2038a..28de9192d9 100644 --- a/pcbnew/drc/drc_rtree.h +++ b/pcbnew/drc/drc_rtree.h @@ -79,7 +79,12 @@ public: ~DRC_RTREE() { for( auto tree : m_tree ) + { + for( auto el : *tree ) + delete el; + delete tree; + } } /**