]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/JSBSim.cxx
Fix for bug #204 and #222 by Bertrand Coconnier; NaNs (bug #222) were basically gener...
[flightgear.git] / src / FDM / JSBSim / JSBSim.cxx
index 4fb0f43edce0fc3eee2a4921aa3b60279e7a6933..a2d217ba2989dbc8774f296fc7c0cc62d4ed30b2 100644 (file)
@@ -424,6 +424,33 @@ void FGJSBsim::init()
 
 /******************************************************************************/
 
+void checkTied ( FGPropertyManager *node )
+{
+  int N = node->nChildren();
+  string name;
+
+  for (int i=0; i<N; i++) {
+    if (node->getChild(i)->nChildren() ) {
+      checkTied( (FGPropertyManager*)node->getChild(i) );
+    }
+    if ( node->getChild(i)->isTied() ) {
+      name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName();
+      node->Untie(name);
+    }
+  }
+}
+
+/******************************************************************************/
+
+void FGJSBsim::unbind()
+{
+  SGPropertyNode* instance = globals->get_props()->getNode("/fdm/jsbsim");
+  checkTied((FGPropertyManager*)instance);
+  FGInterface::unbind();
+}
+
+/******************************************************************************/
+
 // Run an iteration of the EOM (equations of motion)
 
 void FGJSBsim::update( double dt )