]> git.mxchange.org Git - flightgear.git/commitdiff
Added null pointer check to AI subsystem tear down in FGGlobals destructor to avoid...
authorCsaba Halasz <Csaba.Halasz@gmail.com>
Sat, 30 Oct 2010 22:36:54 +0000 (00:36 +0200)
committerCsaba Halasz <Csaba.Halasz@gmail.com>
Sat, 30 Oct 2010 22:36:54 +0000 (00:36 +0200)
src/Main/globals.cxx

index db6eef28c1412a3f717483cce18e672ae2860c2e..c28c9f5d2f647818ad643dfcd2de1fc69b250c9d 100644 (file)
@@ -167,8 +167,10 @@ FGGlobals::~FGGlobals()
     // shut down all subsystems, make sure we take down the 
     // AIModels system first.
     SGSubsystem* ai = subsystem_mgr->remove("ai_model");
-    ai->unbind();
-    delete ai;
+    if (ai) {
+        ai->unbind();
+        delete ai;
+    }
     
     subsystem_mgr->unbind();
     delete subsystem_mgr;