Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -148,6 +151,8 @@ void shutdownMemoryManager()
}

theMainInitFlag = false;

DEBUG_SHUTDOWN();
}


Expand Down
6 changes: 3 additions & 3 deletions Generals/Code/Main/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -148,6 +151,8 @@ void shutdownMemoryManager()
}

theMainInitFlag = false;

DEBUG_SHUTDOWN();
}


Expand Down
6 changes: 3 additions & 3 deletions GeneralsMD/Code/Main/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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
Expand Down
Loading