]> git.mxchange.org Git - flightgear.git/commitdiff
Closedown crash prevention
authorRichard Harrison <rjh@zaretto.com>
Fri, 10 Apr 2015 21:46:13 +0000 (23:46 +0200)
committerRichard Harrison <rjh@zaretto.com>
Fri, 10 Apr 2015 21:51:32 +0000 (23:51 +0200)
src/Cockpit/od_gauge.cxx
src/Scripting/NasalSys.cxx

index 883a17178036aabfa0a814506dca636056fd7cb2..dfb5617a3f9381f7e78282afd42f52561115dbc5 100644 (file)
@@ -127,8 +127,10 @@ class ReplaceStaticTextureVisitor:
       simgear::EffectGeode* eg = dynamic_cast<simgear::EffectGeode*>(&node);
       if( !eg )
         return;
-
-      osg::StateSet* ss = eg->getEffect()->getDefaultStateSet();
+         simgear::Effect* eff = eg->getEffect();
+         if (!eff)
+                 return;
+      osg::StateSet* ss = eff->getDefaultStateSet();
       if( !ss )
         return;
 
index d37afa7012285f737b4f3d2b732d785301500139..59a50867a8f29060f19d4604d74aa6c565010e57 100644 (file)
@@ -1165,7 +1165,9 @@ bool FGNasalSys::createModule(const char* moduleName, const char* fileName,
     naRef locals;
     naRef modname = naNewString(ctx);
     naStr_fromdata(modname, (char*)moduleName, strlen(moduleName));
-    if(!naHash_get(_globals, modname, &locals))
+       if (!((_globals).ref).ptr.obj)
+               return false;
+       if (!naHash_get(_globals, modname, &locals))
         locals = naNewHash(ctx);
 
     _cmdArg = (SGPropertyNode*)cmdarg;