diff options
author | Nipun Garg | 2019-06-01 21:42:25 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:42 +0200 |
commit | 6e6de19c7778ec55bccf252b92efedf10b943e60 (patch) | |
tree | 4c1994510ddc91c94a7dba14a176abe4b0126d37 | |
parent | 7a00e0b6a183c89e4f80d260ad7765f4219573c4 (diff) | |
download | scummvm-rg350-6e6de19c7778ec55bccf252b92efedf10b943e60.tar.gz scummvm-rg350-6e6de19c7778ec55bccf252b92efedf10b943e60.tar.bz2 scummvm-rg350-6e6de19c7778ec55bccf252b92efedf10b943e60.zip |
HDB: Add destructors to Picture and Tile
_surface is freed in the destructors for Picture
and Tile
-rw-r--r-- | engines/hdb/draw-manager.cpp | 8 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 7e558e04a5..80ba1c77d5 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -38,6 +38,10 @@ void DrawMan::loadTile32(char *name, uint32 *length) { } +Picture::~Picture() { + _surface.free(); +} + Graphics::Surface Picture::load(Common::SeekableReadStream *stream) { _width = stream->readUint32LE(); _height = stream->readUint32LE(); @@ -64,6 +68,10 @@ Graphics::Surface Picture::load(Common::SeekableReadStream *stream) { return _surface; } +Tile::~Tile() { + _surface.free(); +} + Graphics::Surface Tile::load(Common::SeekableReadStream *stream) { _flags = stream->readUint32LE(); stream->read(_name, 64); diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 0f8d0442dc..9845ffa16e 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -64,6 +64,8 @@ private: class Picture { public: + ~Picture(); + Graphics::Surface load(Common::SeekableReadStream *stream); private: @@ -77,6 +79,9 @@ private: class Tile { public: + + ~Tile(); + Graphics::Surface load(Common::SeekableReadStream *stream); private: |