From: mfranz Date: Wed, 24 May 2006 09:37:44 +0000 (+0000) Subject: if we are going to die we better tell all our listeners X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0da50eaa79869ce9ea5e14fecfca032c3307c422;p=simgear.git if we are going to die we better tell all our listeners --- diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index 722dfee9..90efffed 100644 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -756,7 +756,12 @@ SGPropertyNode::~SGPropertyNode () _removedChildren[i]->_parent = 0; delete _path_cache; clearValue(); - delete _listeners; + + if (_listeners) { + for (unsigned i = 0; i < _listeners.size(); ++i) + _listeners[i]->unregister_property(this); + delete _listeners; + } }