From: Erik Hofman Date: Fri, 29 Oct 2010 07:10:59 +0000 (+0200) Subject: Merge branch 'next' of git://gitorious.org/fg/flightgear into next X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e7ed88af92e583fecf936b827ffb325ae733d6c5;p=flightgear.git Merge branch 'next' of git://gitorious.org/fg/flightgear into next --- e7ed88af92e583fecf936b827ffb325ae733d6c5 diff --cc src/FDM/JSBSim/FGFDMExec.cpp index 6a12cec2b,f02d23e64..616dd6ea6 --- a/src/FDM/JSBSim/FGFDMExec.cpp +++ b/src/FDM/JSBSim/FGFDMExec.cpp @@@ -101,13 -101,11 +101,13 @@@ FGFDMExec::FGFDMExec(FGPropertyManager FDMctr = new unsigned int; *FDMctr = 0; Initialize(); + root_overload = (root != NULL); } - FGFDMExec::FGFDMExec(FGPropertyManager* root, unsigned int* fdmctr) : Root(root), FDMctr(fdmctr) + FGFDMExec::FGFDMExec(FGPropertyManager* root, unsigned int* fdmctr) : Root(root), delete_root(false), FDMctr(fdmctr) { Initialize(); + root_overload = (root != NULL); } void FGFDMExec::Initialize() @@@ -196,12 -195,13 +197,13 @@@ FGFDMExec::~FGFDMExec( checkTied( instance ); DeAllocate(); - if (IdFDM == 0) { // Meaning this is no child FDM + if(FDMctr != 0 && !root_overload) { if(Root != 0) { - delete Root; + if (delete_root) + delete Root; Root = 0; } - if(FDMctr != 0) { + if (IdFDM == 0) { // Meaning this is no child FDM delete FDMctr; FDMctr = 0; }