HDB: Add destructors to Picture and Tile

_surface is freed in the destructors for Picture
and Tile
This commit is contained in:
Nipun Garg 2019-06-01 21:42:25 +05:30 committed by Eugene Sandulenko
parent 7a00e0b6a1
commit 6e6de19c77
2 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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: