From b9d3c3ccb6070024400034817b734fa1ea8387bd Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 9 Mar 2006 13:30:28 +0000 Subject: [PATCH] check if the "nasal" subsystem is still there, and only call then. This isn't the case if the model is destroyed on fgfs exit. To make 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 7e8cba465..486f5a189 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -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)); -- 2.39.5