From 2e078aff7d3c926d8e7fa13ccc180fc5497dd0d5 Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 14 Mar 2006 10:38:06 +0000 Subject: [PATCH] prevent animations from losing nodes, because other processes removed them (We are currently getting a lot of aborts in the condition code when running MP. I don't expect this to fix it, but a bug is a bug.) (reviewed by Fred, who also fixed *my* bugs :-) --- simgear/props/condition.cxx | 3 --- simgear/props/condition.hxx | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/simgear/props/condition.cxx b/simgear/props/condition.cxx index 014aff45..a633cacd 100644 --- a/simgear/props/condition.cxx +++ b/simgear/props/condition.cxx @@ -235,7 +235,6 @@ SGComparisonCondition::SGComparisonCondition (Type type, bool reverse) SGComparisonCondition::~SGComparisonCondition () { - delete _right_value; } bool @@ -267,7 +266,6 @@ void SGComparisonCondition::setRightProperty( SGPropertyNode *prop_root, const char * propname ) { - delete _right_value; _right_value = 0; _right_property = prop_root->getNode(propname, true); } @@ -276,7 +274,6 @@ void SGComparisonCondition::setRightValue (const SGPropertyNode *node) { _right_property = 0; - delete _right_value; _right_value = new SGPropertyNode(*node); } diff --git a/simgear/props/condition.hxx b/simgear/props/condition.hxx index b314cc4e..01ad8faa 100644 --- a/simgear/props/condition.hxx +++ b/simgear/props/condition.hxx @@ -51,7 +51,7 @@ public: virtual ~SGPropertyCondition (); virtual bool test () const { return _node->getBoolValue(); } private: - const SGPropertyNode * _node; + SGConstPropertyNode_ptr _node; }; @@ -133,9 +133,9 @@ public: private: Type _type; bool _reverse; - const SGPropertyNode * _left_property; - const SGPropertyNode * _right_property; - const SGPropertyNode * _right_value; + SGConstPropertyNode_ptr _left_property; + SGConstPropertyNode_ptr _right_property; + SGConstPropertyNode_ptr _right_value; };