Howto:Disable Nasal entirely: Difference between revisions

Jump to navigation Jump to search
m
→‎Patch: FGNasalSys null pointer check for NasalModelData
m (→‎Patch: FGNasalSys null pointer check for NasalModelData)
Line 347: Line 347:
     nasal::Hash nasalPkg = nasalGlobals.createHash("pkg"); // module
     nasal::Hash nasalPkg = nasalGlobals.createHash("pkg"); // module
     nasalPkg.set("root", packageRoot);
     nasalPkg.set("root", packageRoot);
diff --git a/src/Scripting/NasalModelData.cxx b/src/Scripting/NasalModelData.cxx
index e4f2269..930790d 100644
--- a/src/Scripting/NasalModelData.cxx
+++ b/src/Scripting/NasalModelData.cxx
@@ -118,6 +118,11 @@ void FGNasalModelData::load()
  const char *s = _load ? _load->getStringValue() : "";
  FGNasalSys* nasalSys = (FGNasalSys*) globals->get_subsystem("nasal");
+  if(!nasalSys) {
+ NASAL_DISABLED("NasalModelData");
+ return;
+  }
+
  // Add _module_id to script local hash to allow placing canvasses on objects
  // inside the model.
  nasal::Hash module = nasalSys->getGlobals().createHash(_module);
diff --git a/src/Scripting/NasalPositioned.cxx b/src/Scripting/NasalPositioned.cxx
index 55c79a2..cf45960 100644
--- a/src/Scripting/NasalPositioned.cxx
+++ b/src/Scripting/NasalPositioned.cxx
@@ -1831,6 +1831,10 @@ public:
  NasalFPDelegateFactory(naRef code)
  {
    _nasal = (FGNasalSys*) globals->get_subsystem("nasal");
+    if(!_nasal) {
+ NASAL_DISABLED("Nasal flightplan delegates");
+ return;
+ }
    _func = code;
    _gcSaveKey = _nasal->gcSave(_func);
  }
diff --git a/src/Scripting/NasalSys.hxx b/src/Scripting/NasalSys.hxx
diff --git a/src/Scripting/NasalSys.hxx b/src/Scripting/NasalSys.hxx
index 096a591..af01ff2 100644
index 096a591..af01ff2 100644
Line 366: Line 397:
     virtual void shutdown();
     virtual void shutdown();
      
      
</syntaxhighlight>
</syntaxhighlight>

Navigation menu