diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index 43142b4d..433c80fe 100755 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -973,10 +973,9 @@ SGPropertyNode::SGPropertyNode( const std::string& name, */ SGPropertyNode::~SGPropertyNode () { - // 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(); - + // zero out all parent pointers, else they might be dangling + for (unsigned i = 0; i < _children.size(); ++i) + _children[i]->_parent = 0; clearValue(); if (_listeners) { diff --git a/simgear/props/props.hxx b/simgear/props/props.hxx index 08216a23..8ee640ae 100644 --- a/simgear/props/props.hxx +++ b/simgear/props/props.hxx @@ -2045,6 +2045,7 @@ T SGPropertyNode::getValue(typename std::enable_if(make_string()); + break; default: // avoid compiler warning break; }