]> git.mxchange.org Git - flightgear.git/commitdiff
check if the "nasal" subsystem is still there, and only call <unload> then.
authormfranz <mfranz>
Thu, 9 Mar 2006 13:30:28 +0000 (13:30 +0000)
committermfranz <mfranz>
Thu, 9 Mar 2006 13:30:28 +0000 (13:30 +0000)
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.

src/Scripting/NasalSys.cxx

index 7e8cba465a6c478e98918d314fe489dd7378c0d2..486f5a189494745ab5d26b7e478d27df2a5430d4 100644 (file)
@@ -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));