diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp index 9a212dd8fb7..0947b60d528 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameClient.cpp @@ -117,6 +117,10 @@ GameClient::GameClient() //------------------------------------------------------------------------------------------------- GameClient::~GameClient() { + // clear any drawable TOC we might have - do this FIRST to ensure AsciiStrings + // are destroyed while the memory allocator is still in a valid state + m_drawableTOC.clear(); + #ifdef PERF_TIMERS delete TheGraphDraw; TheGraphDraw = NULL; @@ -125,9 +129,6 @@ GameClient::~GameClient() delete TheDrawGroupInfo; TheDrawGroupInfo = NULL; - // clear any drawable TOC we might have - m_drawableTOC.clear(); - //DEBUG_LOG(("Preloaded texture files ------------------------------------------")); //for (Int oog=0; oog