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