From: ThorstenB Date: Wed, 13 Jul 2011 19:52:29 +0000 (+0200) Subject: Don't crash on exit, when initialization was aborted. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dcc8d22f7c19512941d76d47a7f5fffbbec94fbd;p=flightgear.git Don't crash on exit, when initialization was aborted. Some errors cause fgfs to abort/exit before "controls" is set. --- diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 9ed3a6b56..91af653c0 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -182,8 +182,12 @@ FGGlobals::~FGGlobals() delete current_panel; delete ATC_mgr; - controls->unbind(); - delete controls; + + if (controls) + { + controls->unbind(); + delete controls; + } delete channel_options_list; delete initial_waypoints;