]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/gui.cxx
Close all iochannel connections on exit.
[flightgear.git] / src / GUI / gui.cxx
index 631accc8fa2be6adf62872d42fac0336f6a6fd69..8fd6545d378b57f13a2789e4ed95260659702f05 100644 (file)
@@ -66,6 +66,7 @@
 #include <FDM/flight.hxx>
 #include <Main/bfi.hxx>
 #include <Main/fg_init.hxx>
+#include <Main/fg_io.hxx>
 #include <Main/globals.hxx>
 #include <Main/options.hxx>
 #include <Main/views.hxx>
@@ -759,10 +760,10 @@ void goodBye(puObject *)
     }
 #endif
 
-    //  if(gps_bug)
-    //      fclose(gps_bug);
+    // close all external I/O connections
+    fgIOShutdownAll();
 
-    exit(-1);
+    exit(0);
 }
 
 
@@ -1043,7 +1044,9 @@ void AptDialog_OK (puObject *)
         {
             current_options.set_airport_id( AptId.c_str() );
             current_options.set_altitude( -9999.0 );
-           fgSetPosFromAirportID( AptId );
+           // fgSetPosFromAirportID( AptId );
+           fgSetPosFromAirportIDandHdg( AptId, 
+                                        cur_fdm_state->get_Psi() * RAD_TO_DEG);
             BusyCursor(0);
             fgReInitSubsystems();
             BusyCursor(1);