1
0
Fork 0

- moved main to mainLoop, and added top-level main to catch any missed

exceptions; we'll make it smarter later
This commit is contained in:
curt 2001-07-19 04:54:53 +00:00
parent 5abff48c8a
commit 4141c6f8bb

View file

@ -26,6 +26,7 @@
#endif
#include <simgear/compiler.h>
#include <simgear/misc/exception.hxx>
#ifdef SG_MATH_EXCEPTION_CLASH
# include <math.h>
@ -1426,8 +1427,8 @@ int fgGlutInitEvents( void ) {
}
// Main ...
int main( int argc, char **argv ) {
// Main loop
int mainLoop( int argc, char **argv ) {
#if defined( macintosh )
freopen ("stdout.txt", "w", stdout );
@ -1757,6 +1758,26 @@ int main( int argc, char **argv ) {
// $$$ end - added VS Renganathan, 15 Oct 2K
// - added Venky , 12 Nov 2K
// Main entry point; catch any exceptions that have made it this far.
int main ( int argc, char **argv ) {
// FIXME: add other, more specific
// exceptions.
try {
mainLoop(argc, argv);
} catch (sg_io_exception e1) {
SG_LOG(SG_GENERAL, SG_ALERT,
"Fatal error " << e1.getMessage()
<< " received from " << e1.getOrigin()
<< "\n at " << e1.getLocation().asString());
} catch (sg_exception e) {
SG_LOG(SG_GENERAL, SG_ALERT,
"Fatal error " << e.getMessage()
<< " received from " << e.getOrigin());
exit(1);
}
}
void fgLoadDCS(void) {
ssgEntity *ship_obj = NULL;