diff --git a/Core/Tools/ImagePacker/Source/WinMain.cpp b/Core/Tools/ImagePacker/Source/WinMain.cpp index 755978bd5a..205d8768ea 100644 --- a/Core/Tools/ImagePacker/Source/WinMain.cpp +++ b/Core/Tools/ImagePacker/Source/WinMain.cpp @@ -84,8 +84,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, Int nCmdShow ) { - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early initMemoryManager(); // save application instance @@ -114,9 +113,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, delete TheImagePacker; TheImagePacker = NULL; - // close the log shutdownMemoryManager(); - DEBUG_SHUTDOWN(); // all done return 0; diff --git a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp index b1f4c488fa..b85825f4d7 100644 --- a/Core/Tools/MapCacheBuilder/Source/WinMain.cpp +++ b/Core/Tools/MapCacheBuilder/Source/WinMain.cpp @@ -212,8 +212,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, Int nCmdShow ) { - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early initMemoryManager(); try @@ -325,9 +324,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, DEBUG_CRASH(("Munkee munkee!")); } - // close the log shutdownMemoryManager(); - DEBUG_SHUTDOWN(); // all done return 0; diff --git a/Generals/Code/Tools/GUIEdit/Source/WinMain.cpp b/Generals/Code/Tools/GUIEdit/Source/WinMain.cpp index c8fae1cf18..5b251bb58c 100644 --- a/Generals/Code/Tools/GUIEdit/Source/WinMain.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/WinMain.cpp @@ -199,8 +199,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance, } ::SetCurrentDirectory(buffer); - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early initMemoryManager(); // register a class for our window with the OS @@ -275,9 +274,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance, delete TheEditor; TheEditor = NULL; - // close the log shutdownMemoryManager(); - DEBUG_SHUTDOWN(); return msg.wParam; diff --git a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 8c853cea4b..83086d52f6 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -274,13 +274,13 @@ BOOL CWorldBuilderApp::InitInstance() // initialization _set_se_translator( DumpExceptionInfo ); // Hook that allows stack trace. - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early + initMemoryManager(); + DEBUG_LOG(("starting Worldbuilder.")); #ifdef RTS_DEBUG DEBUG_LOG(("RTS_DEBUG defined.")); #endif - initMemoryManager(); #ifdef MEMORYPOOL_CHECKPOINTING gFirstCP = TheMemoryPoolFactory->debugSetCheckpoint(); #endif @@ -644,7 +644,6 @@ int CWorldBuilderApp::ExitInstance() TheMemoryPoolFactory->debugMemoryReport(REPORT_FACTORYINFO | REPORT_CP_LEAKS | REPORT_CP_STACKTRACE, gFirstCP, lastCP); #endif shutdownMemoryManager(); - DEBUG_SHUTDOWN(); return CWinApp::ExitInstance(); } diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp index cbe8569b0c..8ecdc3de45 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/WinMain.cpp @@ -199,8 +199,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance, } ::SetCurrentDirectory(buffer); - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early initMemoryManager(); // register a class for our window with the OS @@ -275,9 +274,7 @@ Int APIENTRY WinMain(HINSTANCE hInstance, delete TheEditor; TheEditor = NULL; - // close the log shutdownMemoryManager(); - DEBUG_SHUTDOWN(); return msg.wParam; diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp index 95c3f677fc..1f44f7fe15 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp @@ -280,8 +280,8 @@ BOOL CWorldBuilderApp::InitInstance() // initialization _set_se_translator( DumpExceptionInfo ); // Hook that allows stack trace. - // start the log - DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + // initialize the memory manager early + initMemoryManager(); #ifdef DEBUG_LOGGING // Turn on console output jba [3/20/2003] @@ -293,7 +293,6 @@ BOOL CWorldBuilderApp::InitInstance() #ifdef RTS_DEBUG DEBUG_LOG(("RTS_DEBUG defined.")); #endif - initMemoryManager(); #ifdef MEMORYPOOL_CHECKPOINTING gFirstCP = TheMemoryPoolFactory->debugSetCheckpoint(); #endif @@ -667,7 +666,6 @@ int CWorldBuilderApp::ExitInstance() TheMemoryPoolFactory->debugMemoryReport(REPORT_POOLINFO | REPORT_POOL_OVERFLOW | REPORT_SIMPLE_LEAKS, 0, 0); #endif shutdownMemoryManager(); - DEBUG_SHUTDOWN(); return CWinApp::ExitInstance(); }