]> git.mxchange.org Git - flightgear.git/commitdiff
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
authorErik Hofman <erik@ehofman.com>
Fri, 29 Oct 2010 07:10:59 +0000 (09:10 +0200)
committerErik Hofman <erik@ehofman.com>
Fri, 29 Oct 2010 07:10:59 +0000 (09:10 +0200)
1  2 
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h

index 6a12cec2bf584dd7757736a511c3a2a7cac76002,f02d23e6400ee8e02a3eb968c14c988bbff920d5..616dd6ea6e2c893c859edb2ef25142996e99819a
@@@ -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;
        }
Simple merge