From b8269c7f8406180ebb1d199191899509f6cd709e Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Sun, 2 Nov 2025 15:19:06 +0000 Subject: [PATCH] GameClient: Move m_drawableTOC.clear() to the beginning of the destructor --- Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | 7 ++++--- .../Code/GameEngine/Source/GameClient/GameClient.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) 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