From: curt Date: Mon, 16 Jul 2001 04:14:34 +0000 (+0000) Subject: Use throw to report config file load errors. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3cca0caced21acef0b815e11b84b353b730ae4fd;p=flightgear.git Use throw to report config file load errors. --- diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index b7a8d941a..dc308ffd5 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -95,6 +95,16 @@ FGJSBsim::FGJSBsim( double dt ) engine_path.str(), fgGetString("/sim/aircraft") ); + + if (result) { + SG_LOG( SG_FLIGHT, SG_INFO, + " loaded aircraft."); + } else { + SG_LOG( SG_FLIGHT, SG_INFO, + " aircraft does not exist (you may have mis-typed the name)."); + throw(-1); + } + int Neng = Propulsion->GetNumEngines(); SG_LOG(SG_FLIGHT,SG_INFO, "Neng: " << Neng ); @@ -120,11 +130,9 @@ FGJSBsim::FGJSBsim( double dt ) /******************************************************************************/ FGJSBsim::~FGJSBsim(void) { - if ( fdmex != NULL ) { - delete fdmex; - fdmex = NULL; - delete fgic; - fgic = NULL; + if (fdmex != NULL) { + delete fdmex; fdmex=NULL; + delete fgic; fgic=NULL; } }