mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
ILLUSIONS: Fix some memory leaks (#2106)
This commit is contained in:
parent
9ce1d470be
commit
5ecd4b0bbd
@ -1006,6 +1006,7 @@ Controls::Controls(IllusionsEngine *vm)
|
||||
|
||||
Controls::~Controls() {
|
||||
delete _sequenceOpcodes;
|
||||
destroyControls();
|
||||
}
|
||||
|
||||
void Controls::placeBackgroundObject(BackgroundObject *backgroundObject) {
|
||||
|
@ -60,6 +60,10 @@ DuckmanSpecialCode::~DuckmanSpecialCode() {
|
||||
delete _propertyTimers;
|
||||
delete _inventory;
|
||||
delete _credits;
|
||||
|
||||
for (SpecialCodeMap::iterator it = _specialCodeMap.begin(); it != _specialCodeMap.end(); ++it) {
|
||||
delete (*it)._value;
|
||||
}
|
||||
}
|
||||
|
||||
typedef Common::Functor1Mem<OpCall&, void, DuckmanSpecialCode> SpecialCodeFunctionDM;
|
||||
|
@ -34,6 +34,7 @@ GamArchive::GamArchive(const char *filename)
|
||||
|
||||
GamArchive::~GamArchive() {
|
||||
delete[] _groups;
|
||||
delete _fd;
|
||||
}
|
||||
|
||||
byte *GamArchive::readResource(uint32 sceneId, uint32 resId, uint32 &dataSize) {
|
||||
|
@ -43,6 +43,7 @@ void GameState::writeState(uint32 sceneId, uint32 threadId) {
|
||||
writeStream->writeUint32LE(sceneId);
|
||||
writeStream->writeUint32LE(threadId);
|
||||
writeStateInternal(writeStream);
|
||||
delete writeStream;
|
||||
}
|
||||
|
||||
void GameState::read(Common::ReadStream *in) {
|
||||
|
@ -36,6 +36,7 @@ ScreenText::ScreenText(IllusionsEngine *vm)
|
||||
}
|
||||
|
||||
ScreenText::~ScreenText() {
|
||||
freeTextSurface();
|
||||
}
|
||||
|
||||
void ScreenText::getTextInfoDimensions(WidthHeight &textInfoDimensions) {
|
||||
|
@ -344,4 +344,12 @@ bool ThreadList::isActiveThread(int msgNum) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ThreadList::~ThreadList() {
|
||||
Iterator it = _threads.begin();
|
||||
while (it != _threads.end()) {
|
||||
delete *it;
|
||||
it = _threads.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Illusions
|
||||
|
@ -105,6 +105,7 @@ public:
|
||||
void setThreadSceneId(uint32 threadId, uint32 sceneId);
|
||||
uint32 getThreadSceneId(uint32 threadId);
|
||||
bool isActiveThread(int msgNum);
|
||||
~ThreadList();
|
||||
protected:
|
||||
typedef Common::List<Thread*> List;
|
||||
typedef List::iterator Iterator;
|
||||
|
Loading…
Reference in New Issue
Block a user