]> git.mxchange.org Git - flightgear.git/commitdiff
Don't crash on exit, when initialization was aborted.
authorThorstenB <brehmt@gmail.com>
Wed, 13 Jul 2011 19:52:29 +0000 (21:52 +0200)
committerThorstenB <brehmt@gmail.com>
Wed, 13 Jul 2011 19:52:29 +0000 (21:52 +0200)
Some errors cause fgfs to abort/exit before "controls" is set.

src/Main/globals.cxx

index 9ed3a6b56478bddcadc44b845ee6e3dbd53d2f7d..91af653c03c96b1b9ab5f9154fae8fd90cc3898b 100644 (file)
@@ -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;