mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
PINK: fix mem leaks
This commit is contained in:
parent
f11d331129
commit
0659ca4846
@ -36,6 +36,7 @@ GamePage::GamePage()
|
||||
|
||||
GamePage::~GamePage() {
|
||||
clear();
|
||||
delete _memFile;
|
||||
}
|
||||
|
||||
void GamePage::toConsole() {
|
||||
|
@ -40,6 +40,10 @@ Sequencer::~Sequencer() {
|
||||
for (uint i = 0; i < _sequences.size(); ++i) {
|
||||
delete _sequences[i];
|
||||
}
|
||||
for (uint i = 0; i < _timers.size(); ++i) {
|
||||
delete _timers[i];
|
||||
}
|
||||
removeContext(_context);
|
||||
}
|
||||
|
||||
void Sequencer::deserialize(Archive &archive) {
|
||||
|
@ -32,6 +32,12 @@ namespace Pink {
|
||||
WalkMgr::WalkMgr()
|
||||
: _isWalking(false), _leadActor(nullptr) {}
|
||||
|
||||
WalkMgr::~WalkMgr() {
|
||||
for (uint i = 0; i < _locations.size(); ++i) {
|
||||
delete _locations[i];
|
||||
}
|
||||
}
|
||||
|
||||
void WalkMgr::deserialize(Pink::Archive &archive) {
|
||||
_leadActor = static_cast<LeadActor *>(archive.readObject());
|
||||
_locations.deserialize(archive);
|
||||
|
@ -42,6 +42,7 @@ struct Coordinates {
|
||||
class WalkMgr : public Object {
|
||||
public:
|
||||
WalkMgr();
|
||||
~WalkMgr() override;
|
||||
virtual void deserialize(Archive &archive);
|
||||
void toConsole() override;
|
||||
|
||||
|
@ -261,6 +261,7 @@ Common::Error PinkEngine::loadGameState(int slot) {
|
||||
_nextPage = archive.readString();
|
||||
initModule(archive.readString(), "", &archive);
|
||||
|
||||
delete in;
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ void Sound::play(Common::SafeSeekableSubReadStream *stream, Audio::Mixer::SoundT
|
||||
mixer->stopHandle(_handle);
|
||||
|
||||
Audio::AudioStream *audioStream;
|
||||
Audio::SeekableAudioStream *wavStream = Audio::makeWAVStream(stream, DisposeAfterUse::NO);
|
||||
Audio::SeekableAudioStream *wavStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
|
||||
if (isLoop)
|
||||
audioStream = Audio::makeLoopingAudioStream(wavStream, 0, 0, 0);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user