]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/propertyObject.cxx
Revert to c++98
[simgear.git] / simgear / props / propertyObject.cxx
index 3eea0ac2361ed11cb1565fa2ab6ba7b7ed0bc617..7a46056080ea67b153c27d53d4628d4c2abbd8cf 100644 (file)
@@ -32,6 +32,13 @@ void PropertyObjectBase::setDefaultRoot(SGPropertyNode* aRoot)
 {
   static_defaultRoot = aRoot;
 }
+  
+PropertyObjectBase::PropertyObjectBase() :
+  _path(NULL),
+  _prop(NULL)
+{
+    
+}
 
 PropertyObjectBase::PropertyObjectBase(const PropertyObjectBase& aOther) :
   _path(aOther._path),
@@ -59,15 +66,17 @@ SGPropertyNode* PropertyObjectBase::node(bool aCreate) const
     return _prop;
   }
   
-  SGPropertyNode* r = _prop ? _prop : static_defaultRoot;
-  _prop = r->getNode(_path, aCreate);
+  SGPropertyNode *r = _prop ? _prop : static_defaultRoot,
+                 *prop = r->getNode(_path, aCreate);
   
-  if (_prop) {
-    // resolve worked, we will cache from now on, so clear _path
+  if( prop )
+  {
+    // resolve worked, we will cache from now on, so clear _path and cache prop
     _path = NULL;
+    _prop = prop;
   }
 
-  return _prop;
+  return prop;
 }
 
 SGPropertyNode* PropertyObjectBase::getOrThrow() const