1
0
Fork 0

temporary fix for a crash of the c172 (and possibly other aircraft)

This commit is contained in:
Erik Hofman 2010-10-29 09:10:07 +02:00
parent 68f5429048
commit 61788d6558
2 changed files with 5 additions and 2 deletions

View file

@ -101,11 +101,13 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root) : Root(root)
FDMctr = new unsigned int;
*FDMctr = 0;
Initialize();
root_overload = (root != NULL);
}
FGFDMExec::FGFDMExec(FGPropertyManager* root, unsigned int* fdmctr) : Root(root), FDMctr(fdmctr)
{
Initialize();
root_overload = (root != NULL);
}
void FGFDMExec::Initialize()
@ -194,12 +196,12 @@ FGFDMExec::~FGFDMExec()
checkTied( instance );
DeAllocate();
if (IdFDM == 0) { // Meaning this is no child FDM
if(FDMctr != 0 && !root_overload) {
if(Root != 0) {
delete Root;
Root = 0;
}
if(FDMctr != 0) {
if (IdFDM == 0) { // Meaning this is no child FDM
delete FDMctr;
FDMctr = 0;
}

View file

@ -524,6 +524,7 @@ private:
bool Constructing;
bool modelLoaded;
bool IsChild;
bool root_overload;
string modelName;
string AircraftPath;
string FullAircraftPath;