1
0
Fork 0

gui/embedded nasal: don't rely on the nasal system being available

This commit is contained in:
mfranz 2009-03-27 20:04:42 +00:00 committed by Tim Moore
parent 1a1b11b96c
commit 6a590ce9de

View file

@ -470,6 +470,7 @@ FGDialog::FGDialog (SGPropertyNode *props) :
if (open) { if (open) {
const char *s = open->getStringValue(); const char *s = open->getStringValue();
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal"); FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
if (nas)
nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s), props); nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s), props);
} }
} }
@ -484,11 +485,13 @@ FGDialog::~FGDialog ()
_props->setIntValue("lasty", y); _props->setIntValue("lasty", y);
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal"); FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
if (nas) {
if (_nasal_close) { if (_nasal_close) {
const char *s = _nasal_close->getStringValue(); const char *s = _nasal_close->getStringValue();
nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s), _props); nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s), _props);
} }
nas->deleteModule(_module.c_str()); nas->deleteModule(_module.c_str());
}
puDeleteObject(_object); puDeleteObject(_object);