Fix a JSBSim crash on OSG-quit
(i.e Cmd-Q / window closing, not the normal FlightGear quit sequence)
This commit is contained in:
parent
8877b442f8
commit
a55c939c5e
3 changed files with 7 additions and 3 deletions
|
@ -235,7 +235,9 @@ FGAIBase::removeModel()
|
|||
}
|
||||
else
|
||||
{
|
||||
SG_LOG(SG_AI, SG_ALERT, "AIBase: Could not unload model. Missing scenery manager!");
|
||||
aip.clear();
|
||||
_model = 0;
|
||||
_modeldata = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -229,6 +229,8 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
fgGetNode("/fdm/jsbsim/sim-time-sec", true)->alias( node );
|
||||
// end of sim-time-sec deprecation patch
|
||||
|
||||
terrain = fgGetNode("/sim/fdm/surface", true);
|
||||
|
||||
fdmex->Setdt( dt );
|
||||
|
||||
result = fdmex->LoadModel( aircraft_path.str(),
|
||||
|
@ -1352,8 +1354,6 @@ FGJSBsim::get_agl_ft(double t, const double pt[3], double alt_off,
|
|||
SGQuatd hlToEc = SGQuatd::fromLonLat(geodPt);
|
||||
*agl = dot(hlToEc.rotate(SGVec3d(0, 0, 1)), SGVec3d(contact) - SGVec3d(pt));
|
||||
|
||||
static SGPropertyNode_ptr terrain = fgGetNode("/sim/fdm/surface", true);
|
||||
|
||||
#ifdef JSBSIM_USE_GROUNDREACTIONS
|
||||
bool terrain_active = (terrain->getIntValue("override-level", -1) > 0) ? false : true;
|
||||
terrain->setBoolValue("active", terrain_active);
|
||||
|
|
|
@ -288,6 +288,8 @@ private:
|
|||
|
||||
SGPropertyNode_ptr slaved;
|
||||
|
||||
SGPropertyNode_ptr terrain;
|
||||
|
||||
static std::map<std::string,int> TURBULENCE_TYPE_NAMES;
|
||||
|
||||
double last_hook_tip[3];
|
||||
|
|
Loading…
Add table
Reference in a new issue