SGRawValueFunctions<const char *>(0, fgSetNewSoundDevice), false);
}
simgear::AtomicChangeListener::fireChangeListeners();
- fgRequestRedraw();
SG_LOG( SG_ALL, SG_DEBUG, "" );
}
// Main top level initialization
-bool fgMainInit( int argc, char **argv ) {
+int fgMainInit( int argc, char **argv ) {
// set default log levels
sglog().setLogLevels( SG_ALL, SG_ALERT );
fgSplashInit();
// pass control off to the master event handler
- fgOSMainLoop();
-
- // we never actually get here ... but to avoid compiler warnings,
- // etc.
- return false;
+ int result = fgOSMainLoop();
+
+ // clean up here; ensure we null globals to avoid
+ // confusing the atexit() handler
+ delete globals;
+ globals = NULL;
+
+ return result;
}