diff options
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) { |