Needed to bug-fix a problem with the menubar on Mac - post-3.0 I will
change the behaviour of SGBinding's destructor to avoid the property
copies in other use-cases.
_arg->getParent()->removeChild(_arg->getName(), _arg->getIndex(), false);
}
+void
+SGBinding::clear()
+{
+ _command = NULL;
+ _arg.clear();
+ _setting.clear();
+}
+
void
SGBinding::read(const SGPropertyNode* node, SGPropertyNode* root)
{
return result;
}
+
+void clearBindingList(const SGBindingList& aBindings)
+{
+ BOOST_FOREACH(SGBinding_ptr b, aBindings) {
+ b->clear();
+ }
+}
+
*/
virtual ~SGBinding ();
+
+ /**
+ * clear internal state of the binding back to empty. This is useful
+ * if you don't want the 'remove on delete' behaviour of the
+ * destructor.
+ */
+ void clear();
+
/**
* Get the command name.
*/
SGBindingList readBindingList(const simgear::PropertyList& aNodes, SGPropertyNode* aRoot);
+/**
+ * call clear() on every binding in a list
+ */
+void clearBindingList(const SGBindingList& aBindings);
+
#endif