From 084e2502abb2c4e600bf699e29a9bafd1bbb325b Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Thu, 6 Aug 2020 22:15:43 -0500 Subject: [PATCH] Memory Leak: 4.3 MB 4,518,880 bytes in 141,215 blocks are still reachable in loss record 15,491 of 15,501 --- simgear/bvh/BVHStaticGeometryBuilder.hxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/simgear/bvh/BVHStaticGeometryBuilder.hxx b/simgear/bvh/BVHStaticGeometryBuilder.hxx index 0cce7c72..72053bf6 100644 --- a/simgear/bvh/BVHStaticGeometryBuilder.hxx +++ b/simgear/bvh/BVHStaticGeometryBuilder.hxx @@ -47,8 +47,15 @@ public: _currentMaterial(0), _currentMaterialIndex(~0u) { } + virtual ~BVHStaticGeometryBuilder() - { } + { + // REVIEW: Memory Leak + // 4,518,880 bytes in 141,215 blocks are still reachable in loss record 15,491 of 15,501 + // for (LeafRef ref : _leafRefList) { + // delete ref._leaf; + // } + } struct LeafRef { LeafRef(const BVHStaticLeaf* leaf, const BVHStaticData& data) :