]> git.mxchange.org Git - simgear.git/commitdiff
if we are going to die we better tell all our listeners
authormfranz <mfranz>
Wed, 24 May 2006 09:37:44 +0000 (09:37 +0000)
committermfranz <mfranz>
Wed, 24 May 2006 09:37:44 +0000 (09:37 +0000)
simgear/props/props.cxx

index 722dfee93b2b3e91b5e961a730a280a71c528dec..90efffed704cd2950b082f2ab38788d5ff8fa385 100644 (file)
@@ -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;
+  }
 }