Skip to content

Commit 3d610a2

Browse files
committed
[GEN][ZH] Fix setting debugDisplay to NULL and releasing benchmarkDisplayString in W3DDisplay destructor
1 parent d411d2b commit 3d610a2

File tree

2 files changed

+14
-0
lines changed
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient

2 files changed

+14
-0
lines changed

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,18 @@ W3DDisplay::~W3DDisplay()
376376

377377
// get rid of the debug display
378378
delete m_debugDisplay;
379+
m_debugDisplay = NULL;
380+
m_nativeDebugDisplay = NULL;
379381

380382
// delete the display strings
381383
for (int i = 0; i < DisplayStringCount; i++)
382384
TheDisplayStringManager->freeDisplayString(m_displayStrings[i]);
383385

386+
// TheSuperHackers @fix Mauller/Tomsons26 28/04/2025 Delete benchmark display string to allow the clean destruction of the DisplayStringManager
387+
if( m_benchmarkDisplayString ) {
388+
TheDisplayStringManager->freeDisplayString(m_benchmarkDisplayString);
389+
}
390+
384391
// delete 2D renderer
385392
if( m_2DRender )
386393
{

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,18 @@ W3DDisplay::~W3DDisplay()
426426

427427
// get rid of the debug display
428428
delete m_debugDisplay;
429+
m_debugDisplay = NULL;
430+
m_nativeDebugDisplay = NULL;
429431

430432
// delete the display strings
431433
for (int i = 0; i < DisplayStringCount; i++)
432434
TheDisplayStringManager->freeDisplayString(m_displayStrings[i]);
433435

436+
// TheSuperHackers @fix Mauller/Tomsons26 28/04/2025 Delete benchmark display string to allow the clean destruction of the DisplayStringManager
437+
if( m_benchmarkDisplayString ) {
438+
TheDisplayStringManager->freeDisplayString(m_benchmarkDisplayString);
439+
}
440+
434441
// delete 2D renderer
435442
if( m_2DRender )
436443
{

0 commit comments

Comments
 (0)