diff options
author | Dmitry Iskrich | 2016-06-10 19:27:35 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 51843bc3b367eda4f7c3cdcbee7c007c5574b706 (patch) | |
tree | ab2ba2be5bb6d6d4b399a7bc5cc963c1cc2bb207 | |
parent | c7657b994ac490138c27006a24c0f8561e8d5a13 (diff) | |
download | scummvm-rg350-51843bc3b367eda4f7c3cdcbee7c007c5574b706.tar.gz scummvm-rg350-51843bc3b367eda4f7c3cdcbee7c007c5574b706.tar.bz2 scummvm-rg350-51843bc3b367eda4f7c3cdcbee7c007c5574b706.zip |
DIRECTOR: Fix memory leak
-rw-r--r-- | engines/director/score.cpp | 12 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index d1c198fe59..2f9f619eec 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -95,6 +95,14 @@ Score::Score(Archive &movie, Lingo &lingo) { } +Score::~Score() { + _surface->free(); + delete _surface; + + _movieArchive->close(); + delete _movieArchive; +} + void Score::loadFrames(Common::SeekableReadStream &stream) { uint32 size = stream.readUint32BE(); size -= 4; @@ -538,6 +546,10 @@ Frame::~Frame() { for (uint16 i = 0; i < _sprites.size(); i++) { delete _sprites[i]; } + + for (uint16 i = 0; i < _drawRects.size(); i++) { + delete _drawRects[i]; + } } void Frame::readChannel(Common::SeekableReadStream &stream, uint16 offset, uint16 size) { diff --git a/engines/director/score.h b/engines/director/score.h index 00c3294394..3cebbbf542 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -265,6 +265,7 @@ public: class Score { public: Score(Archive &movie, Lingo &lingo); + ~Score(); static Common::Rect readRect(Common::SeekableReadStream &stream); void startLoop(); |