From: Csaba Halasz Date: Sat, 30 Oct 2010 22:36:54 +0000 (+0200) Subject: Added null pointer check to AI subsystem tear down in FGGlobals destructor to avoid... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=27782d7c8b2f8355208ac3ccd7971a02275f9c94;p=flightgear.git Added null pointer check to AI subsystem tear down in FGGlobals destructor to avoid crash when using --help option --- diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index db6eef28c..c28c9f5d2 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -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;