diff options
author | uruk | 2014-04-13 00:10:04 +0200 |
---|---|---|
committer | uruk | 2014-04-13 10:13:48 +0200 |
commit | f2d5f65d3344d82964387ef110637328cc7b3a9b (patch) | |
tree | 0b0cc54878e9c9d41f17c2cbfd6833c0dcc3cc6a /engines | |
parent | ff93bd18a1c4af896cb24c0be090079a0f95a6ca (diff) | |
download | scummvm-rg350-f2d5f65d3344d82964387ef110637328cc7b3a9b.tar.gz scummvm-rg350-f2d5f65d3344d82964387ef110637328cc7b3a9b.tar.bz2 scummvm-rg350-f2d5f65d3344d82964387ef110637328cc7b3a9b.zip |
AVALANCHE: Fix Ghostroom's destructor.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/ghostroom.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 68e3c9ba77..16c79fdee0 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -71,27 +71,29 @@ GhostRoom::~GhostRoom() { _greldet[j][i].free(); } - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 2; j++) { - for (int y = 0; y < 66; y++) { - delete[] _ghost[i][j][y]; + if (_wasLoaded) { + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 2; j++) { + for (int y = 0; y < 66; y++) { + delete[] _ghost[i][j][y]; + } + delete[] _ghost[i][j]; } - delete[] _ghost[i][j]; + delete[] _ghost[i]; } - delete[] _ghost[i]; - } - delete[] _ghost; - - for (int i = 0; i < 6; i++) { - for (int j = 0; j < 4; j++) { - for (int y = 0; y < 35; y++) { - delete[] _glerk[i][j][y]; + delete[] _ghost; + + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 4; j++) { + for (int y = 0; y < 35; y++) { + delete[] _glerk[i][j][y]; + } + delete[] _glerk[i][j]; } - delete[] _glerk[i][j]; + delete[] _glerk[i]; } - delete[] _glerk[i]; + delete[] _glerk; } - delete[] _glerk; } void GhostRoom::wait(uint16 howLong) { |