From: Mathias Froehlich Date: Sun, 5 Jun 2011 11:44:37 +0000 (+0200) Subject: Avoid crashing in hla initialization failure. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d21924770f8d41fdfe395353e59ce92a31a3ae35;p=flightgear.git Avoid crashing in hla initialization failure. --- diff --git a/src/Network/HLA/hla.cxx b/src/Network/HLA/hla.cxx index de12ae2f1..cf6af5eff 100644 --- a/src/Network/HLA/hla.cxx +++ b/src/Network/HLA/hla.cxx @@ -1216,6 +1216,9 @@ FGHLA::open() bool FGHLA::process() { + if (!is_enabled()) + return false; + // First push our own data so that others can recieve ... if (get_direction() & SG_IO_OUT) { if (fgGetBool("/sim/fdm-initialized", false) && _localAircraftClass.valid()) { @@ -1245,6 +1248,9 @@ FGHLA::process() bool FGHLA::close() { + if (!is_enabled()) + return false; + if (get_direction() & SG_IO_OUT) { // Remove the local object from the rti _localAircraftInstance->deleteInstance(simgear::RTIData("gone"));