diff options
author | Eugene Sandulenko | 2019-07-17 23:52:26 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:23 +0200 |
commit | 7b78aa5e9f19e30e92988c274f973029c827e2c5 (patch) | |
tree | 8c5cb72a91d1a9a2870f390464c4e08d9124f306 | |
parent | 161f9e67070f38906cd62b7db65d1d6cf2802823 (diff) | |
download | scummvm-rg350-7b78aa5e9f19e30e92988c274f973029c827e2c5.tar.gz scummvm-rg350-7b78aa5e9f19e30e92988c274f973029c827e2c5.tar.bz2 scummvm-rg350-7b78aa5e9f19e30e92988c274f973029c827e2c5.zip |
HDB: Fix double free() and meaningless 'new' allocations
-rw-r--r-- | engines/hdb/ai.h | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 533d4310a9..aa47996516 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -498,115 +498,56 @@ struct AIEntity { blinkFrames = 0; for (int i = 0; i < kMaxAnimFrames; i++) { - blinkGfx[i] = new Tile; - } - - special1Frames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - special1Gfx[i] = new Tile; - } - - standdownFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - standdownGfx[i] = new Tile; - } - - standupFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - standupGfx[i] = new Tile; - } - - standleftFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - standleftGfx[i] = new Tile; - } - - standrightFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - standrightGfx[i] = new Tile; - } - - movedownFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - movedownGfx[i] = new Tile; - } - - moveupFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - moveupGfx[i] = new Tile; - } - - moveleftFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - moveleftGfx[i] = new Tile; - } - - moverightFrames = 0; - for (int i = 0; i < kMaxAnimFrames; i++) { - moverightGfx[i] = new Tile; - } - } - ~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; } } + ~AIEntity() { + } void save(Common::OutSaveFile *out); void load(Common::InSaveFile *in); |