diff --git a/Generals/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp b/Generals/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp index cbf029dd5a..2bfdf80500 100644 --- a/Generals/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp @@ -111,10 +111,13 @@ void initMemoryManager() { TheMemoryPoolFactory = new (malloc(sizeof MemoryPoolFactory)) MemoryPoolFactory; TheDynamicMemoryAllocator = new (malloc(sizeof DynamicMemoryAllocator)) DynamicMemoryAllocator; + + DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + DEBUG_LOG(("*** Initialized the Null Memory Manager")); } else { - DEBUG_CRASH(("memory manager is already inited")); + DEBUG_CRASH(("Null Memory Manager is already initialized")); } theMainInitFlag = true; @@ -148,6 +151,8 @@ void shutdownMemoryManager() } theMainInitFlag = false; + + DEBUG_SHUTDOWN(); } diff --git a/Generals/Code/Main/WinMain.cpp b/Generals/Code/Main/WinMain.cpp index 55968ebb46..809a5f85a7 100644 --- a/Generals/Code/Main/WinMain.cpp +++ b/Generals/Code/Main/WinMain.cpp @@ -753,6 +753,9 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, TheMemoryPoolCriticalSection = &critSec4; TheDebugLogCriticalSection = &critSec5; + // initialize the memory manager early + initMemoryManager(); + /// @todo remove this force set of working directory later Char buffer[ _MAX_PATH ]; GetModuleFileName( NULL, buffer, sizeof( buffer ) ); @@ -787,9 +790,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // Force to be loaded from a file, not a resource so same exe can be used in germany and retail. gLoadScreenBitmap = (HBITMAP)LoadImage(hInstance, "Install_Final.bmp", IMAGE_BITMAP, 0, 0, LR_SHARED|LR_LOADFROMFILE); - // initialize the memory manager early - initMemoryManager(); - CommandLine::parseCommandLineForStartup(); // register windows class and create application window diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp index cbf029dd5a..2bfdf80500 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/GameMemoryNull.cpp @@ -111,10 +111,13 @@ void initMemoryManager() { TheMemoryPoolFactory = new (malloc(sizeof MemoryPoolFactory)) MemoryPoolFactory; TheDynamicMemoryAllocator = new (malloc(sizeof DynamicMemoryAllocator)) DynamicMemoryAllocator; + + DEBUG_INIT(DEBUG_FLAGS_DEFAULT); + DEBUG_LOG(("*** Initialized the Null Memory Manager")); } else { - DEBUG_CRASH(("memory manager is already inited")); + DEBUG_CRASH(("Null Memory Manager is already initialized")); } theMainInitFlag = true; @@ -148,6 +151,8 @@ void shutdownMemoryManager() } theMainInitFlag = false; + + DEBUG_SHUTDOWN(); } diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index 6f7d9d663e..a600d90618 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -779,6 +779,9 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, TheMemoryPoolCriticalSection = &critSec4; TheDebugLogCriticalSection = &critSec5; + // initialize the memory manager early + initMemoryManager(); + /// @todo remove this force set of working directory later Char buffer[ _MAX_PATH ]; GetModuleFileName( NULL, buffer, sizeof( buffer ) ); @@ -833,9 +836,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, gLoadScreenBitmap = (HBITMAP)LoadImage(hInstance, "Install_Final.bmp", IMAGE_BITMAP, 0, 0, LR_SHARED|LR_LOADFROMFILE); #endif - // initialize the memory manager early - initMemoryManager(); - CommandLine::parseCommandLineForStartup(); // register windows class and create application window