From cb54815cfc42be38c6d5720cb71518daffef2b42 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sat, 8 Aug 2020 20:34:59 -0500 Subject: [PATCH] Memory Leak: 95 MB 99,418,032 bytes in 654,066 blocks are still reachable in loss record 15,500 of 15,501 --- simgear/props/props.cxx | 7 ++++--- simgear/props/props.hxx | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index 433c80fe..43142b4d 100755 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -973,9 +973,10 @@ SGPropertyNode::SGPropertyNode( const std::string& name, */ SGPropertyNode::~SGPropertyNode () { - // zero out all parent pointers, else they might be dangling - for (unsigned i = 0; i < _children.size(); ++i) - _children[i]->_parent = 0; + // REVIEW: Memory Leak: 95 MB + // 99,418,032 bytes in 654,066 blocks are still reachable in loss record 15,500 of 15,501 + removeAllChildren(); + clearValue(); if (_listeners) { diff --git a/simgear/props/props.hxx b/simgear/props/props.hxx index 8ee640ae..08216a23 100644 --- a/simgear/props/props.hxx +++ b/simgear/props/props.hxx @@ -2045,7 +2045,6 @@ T SGPropertyNode::getValue(typename std::enable_if(make_string()); - break; default: // avoid compiler warning break; }