From d8ac02a94af1d24b71a87b32f31815becd46425d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 27 Jan 2003 01:05:19 +0000 Subject: [PATCH] set up LOG as early as possible --- stepmania/src/StepMania.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 6e1eaa86ea..ff0e0c83e4 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -219,7 +219,16 @@ int main(int argc, char* argv[]) ChangeToDirOfExecutable(argv[0]); - atexit(SDL_Quit); /* Clean up on exit */ + /* Set this up second. Do this early, since it's needed for RageException::Throw. + * Do it after ChangeToDirOfExecutable, so the log ends up in the right place. */ + LOG = new RageLog(); +#ifdef _DEBUG + LOG->ShowConsole(); +#endif + + /* Whew--we should be able to crash safely now! */ + + atexit(SDL_Quit); /* Clean up on exit */ /* Fire up the SDL, but don't actually start any subsystems. */ int SDL_flags = 0; @@ -253,10 +262,6 @@ int main(int argc, char* argv[]) // // Create game objects // - LOG = new RageLog(); -#ifdef _DEBUG - LOG->ShowConsole(); -#endif GAMESTATE = new GameState; PREFSMAN = new PrefsManager; GAMEMAN = new GameManager;