Avoid crashing in hla initialization failure.
This commit is contained in:
parent
afca14c372
commit
d21924770f
1 changed files with 6 additions and 0 deletions
|
@ -1216,6 +1216,9 @@ FGHLA::open()
|
||||||
bool
|
bool
|
||||||
FGHLA::process()
|
FGHLA::process()
|
||||||
{
|
{
|
||||||
|
if (!is_enabled())
|
||||||
|
return false;
|
||||||
|
|
||||||
// First push our own data so that others can recieve ...
|
// First push our own data so that others can recieve ...
|
||||||
if (get_direction() & SG_IO_OUT) {
|
if (get_direction() & SG_IO_OUT) {
|
||||||
if (fgGetBool("/sim/fdm-initialized", false) && _localAircraftClass.valid()) {
|
if (fgGetBool("/sim/fdm-initialized", false) && _localAircraftClass.valid()) {
|
||||||
|
@ -1245,6 +1248,9 @@ FGHLA::process()
|
||||||
bool
|
bool
|
||||||
FGHLA::close()
|
FGHLA::close()
|
||||||
{
|
{
|
||||||
|
if (!is_enabled())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (get_direction() & SG_IO_OUT) {
|
if (get_direction() & SG_IO_OUT) {
|
||||||
// Remove the local object from the rti
|
// Remove the local object from the rti
|
||||||
_localAircraftInstance->deleteInstance(simgear::RTIData("gone"));
|
_localAircraftInstance->deleteInstance(simgear::RTIData("gone"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue