check if the "nasal" subsystem is still there, and only call <unload> then.
This isn't the case if the model is destroyed on fgfs exit. To make <unload> work under these circumstances, one would have to reorder subsystem removal, but this doesn't seem overly useful, so we'll do it when we really need it.
This commit is contained in:
parent
c386f00312
commit
b9d3c3ccb6
1 changed files with 3 additions and 0 deletions
|
@ -697,6 +697,9 @@ FGNasalModelData::~FGNasalModelData()
|
|||
return;
|
||||
|
||||
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
|
||||
if (!nas)
|
||||
return;
|
||||
|
||||
if (_unload) {
|
||||
const char *s = _unload->getStringValue();
|
||||
nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s));
|
||||
|
|
Loading…
Reference in a new issue