From 161f9e67070f38906cd62b7db65d1d6cf2802823 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Thu, 18 Jul 2019 02:19:18 +0530 Subject: HDB: NULL each tile after calling destructor --- engines/hdb/ai.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'engines/hdb/ai.h') diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 8b25008648..533d4310a9 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -550,51 +550,61 @@ struct AIEntity { blinkFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete blinkGfx[i]; + blinkGfx[i] = NULL; } special1Frames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete special1Gfx[i]; + special1Gfx[i] = NULL; } standdownFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete standdownGfx[i]; + standdownGfx[i] = NULL; } standupFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete standupGfx[i]; + standupGfx[i] = NULL; } standleftFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete standleftGfx[i]; + standleftGfx[i] = NULL; } standrightFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete standrightGfx[i]; + standrightGfx[i] = NULL; } movedownFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete movedownGfx[i]; + movedownGfx[i] = NULL; } moveupFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete moveupGfx[i]; + moveupGfx[i] = NULL; } moveleftFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete moveleftGfx[i]; + moveleftGfx[i] = NULL; } moverightFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { delete moverightGfx[i]; + moverightGfx[i] = NULL; } } @@ -652,6 +662,7 @@ struct AnimTarget { ~AnimTarget() { for (int i = 0; i < kMaxAnimTFrames; i++) { delete gfxList[i]; + gfxList[i] = NULL; } } }; @@ -680,6 +691,12 @@ struct DlvEnt { destTextName[0] = 0; destGfxName[0] = 0; } + ~DlvEnt() { + delete itemGfx; + itemGfx = NULL; + delete destGfx; + destGfx = NULL; + } }; struct Waypoint { -- cgit v1.2.3