Force sglog() to be initialised before at exit
handler is registered, so logging can be used from
inside our exit handler.
// 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)
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;
}