mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
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
This commit is contained in:
parent
da33617061
commit
6711c5a8cf
engines/lastexpress
@ -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;
|
||||
|
||||
|
@ -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>();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -284,6 +284,11 @@ private:
|
||||
|
||||
isStreamed = false;
|
||||
}
|
||||
|
||||
~SoundEntry() {
|
||||
delete stream;
|
||||
//delete subtitle;
|
||||
}
|
||||
};
|
||||
|
||||
// Engine
|
||||
|
Loading…
Reference in New Issue
Block a user