From: James Turner Date: Wed, 29 Dec 2010 22:46:35 +0000 (+0000) Subject: Fix bug #204, and help with bug #222 - delete all X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6fd33dd2c38d02a017399c6cc67639e801b3509a;p=flightgear.git Fix bug #204, and help with bug #222 - delete all properties under /fdm/jsbsim when deleting the JSBSim interface. --- diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index e8a96c018..15b575123 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -298,6 +298,13 @@ FGJSBsim::FGJSBsim( double dt ) FGJSBsim::~FGJSBsim(void) { delete fdmex; + + SGPropertyNode_ptr jsbsimRoot = fgGetNode("/fdm/jsbsim"); + if (jsbsimRoot) { + SGPropertyNode* fdm = jsbsimRoot->getParent(); + fdm->removeChild("jsbsim", 0, false); + } + // properties are deleted when the sharedPtr above goes away } /******************************************************************************/