diff options
| author | Julien Templier | 2010-11-11 06:18:23 +0000 |
|---|---|---|
| committer | Julien Templier | 2010-11-11 06:18:23 +0000 |
| commit | 6711c5a8cf48c579bb4b972d4717fb6f1a394320 (patch) | |
| tree | 546bb986c01d19c9a375dda3a17341e1fe2d906a /engines/lastexpress/entities | |
| parent | da33617061d3d35becaaa741c8144377bf40f39b (diff) | |
| download | scummvm-rg350-6711c5a8cf48c579bb4b972d4717fb6f1a394320.tar.gz scummvm-rg350-6711c5a8cf48c579bb4b972d4717fb6f1a394320.tar.bz2 scummvm-rg350-6711c5a8cf48c579bb4b972d4717fb6f1a394320.zip | |
LASTEXPRESS: Fix more memory leaks
- Missing deallocation of queued frames in SceneManager
- Leaking functor on each call to entity setup functions
- Add SoundEntry destructor & better Entity cleanup
as reported by digitall
svn-id: r54196
Diffstat (limited to 'engines/lastexpress/entities')
| -rw-r--r-- | engines/lastexpress/entities/entity.cpp | 4 | ||||
| -rw-r--r-- | engines/lastexpress/entities/entity_intern.h | 2 |
2 files changed, 4 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>(); |
