diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index b0dbd10c..1c21ecee 100644 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -827,7 +827,7 @@ SGPropertyNode::trace_read () const * Last used attribute * Update as needed when enum Attribute is changed */ -const int SGPropertyNode::LAST_USED_ATTRIBUTE = PRESERVE; +const int SGPropertyNode::LAST_USED_ATTRIBUTE = PROTECTED; /** * Default constructor: always creates a root node. diff --git a/simgear/props/props.hxx b/simgear/props/props.hxx index 4c2bb242..18512f18 100644 --- a/simgear/props/props.hxx +++ b/simgear/props/props.hxx @@ -814,7 +814,8 @@ public: TRACE_READ = 16, TRACE_WRITE = 32, USERARCHIVE = 64, - PRESERVE = 128 + PRESERVE = 128, + PROTECTED = 1 << 8, // beware: if you add another attribute here, // also update value of "LAST_USED_ATTRIBUTE". }; @@ -1854,7 +1855,7 @@ private: mutable std::string _buffer; simgear::props::Type _type; bool _tied; - int _attr; + int _attr = NO_ATTR; // The right kind of pointer... union { diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index a0e0b90b..ee432b33 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -251,6 +251,9 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts) setFlag(mode, SGPropertyNode::USERARCHIVE, val, location); else if( att_name == "preserve" ) setFlag(mode, SGPropertyNode::PRESERVE, val, location); + // note we intentionally don't handle PROTECTED here, it's + // designed to be only set from compiled code, not loaded + // dynamically. // Check for an alias. else if( att_name == "alias" )