]> git.mxchange.org Git - flightgear.git/commitdiff
Work-around for issue 1231.
authorJames Turner <zakalawe@mac.com>
Tue, 15 Oct 2013 21:02:36 +0000 (22:02 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 15 Oct 2013 21:02:36 +0000 (22:02 +0100)
Force sglog() to be initialised before at exit
handler is registered, so logging can be used from
inside our exit handler.

src/Main/bootstrap.cxx

index 73fb6fd5e162f3a67862a8b88feafdd94c447986..0a68e2345c4521326453509eba6d6c2fa55361dd 100644 (file)
@@ -236,6 +236,11 @@ int main ( int argc, char **argv )
     // FIXME: add other, more specific
     // exceptions.
     try {
+        // http://code.google.com/p/flightgear-bugs/issues/detail?id=1231
+        // ensure sglog is inited before atexit() is registered, so logging
+        // is possible inside fgExitCleanup
+        sglog();
+        
         std::set_terminate(fg_terminate);
         atexit(fgExitCleanup);
         if (fgviewer)
@@ -277,6 +282,8 @@ void fgExitCleanup() {
     if (_bootstrap_OSInit != 0)
         fgSetMouseCursor(MOUSE_CURSOR_POINTER);
 
+    // on the common exit path globals is already deleted, and NULL,
+    // so this only happens on error paths.
     delete globals;
 }