diff options
-rw-r--r-- | engines/lastexpress/entities/entity.cpp | 4 | ||||
-rw-r--r-- | engines/lastexpress/entities/entity_intern.h | 2 | ||||
-rw-r--r-- | engines/lastexpress/game/scenes.cpp | 4 | ||||
-rw-r--r-- | engines/lastexpress/game/sound.h | 5 |
4 files changed, 13 insertions, 2 deletions
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 3291b49e9b..6ca0155dcb 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -150,7 +150,9 @@ Entity::Entity(LastExpressEngine *engine, EntityIndex index) : _engine(engine), Entity::~Entity() { for (uint i = 0; i < _callbacks.size(); i++) - delete _callbacks[i]; + SAFE_DELETE(_callbacks[i]); + + _callbacks.clear(); delete _data; diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index 71607ed511..6f80d29d8c 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -83,7 +83,7 @@ void class::setup_##name() { \ } #define BEGIN_SETUP(class, name, index, type) \ - _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, new ENTITY_CALLBACK(class, name, this)); \ + _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]); \ _data->setCurrentCallback(index); \ _data->resetCurrentParameters<type>(); diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index cf50d3e425..3f9aa0b3b3 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -62,6 +62,10 @@ SceneManager::~SceneManager() { SAFE_DELETE(_clockHours); SAFE_DELETE(_clockMinutes); + // Clear frame queue + for (Common::List<SequenceFrame *>::iterator i = _queue.begin(); i != _queue.end(); ++i) + SAFE_DELETE(*i); + // Zero-out passed pointers _engine = NULL; } diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index 8c5c6aea0d..cf08cd7ee8 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -284,6 +284,11 @@ private: isStreamed = false; } + + ~SoundEntry() { + delete stream; + //delete subtitle; + } }; // Engine |