diff options
author | Kamil Zbróg | 2013-11-05 22:25:17 +0000 |
---|---|---|
committer | Kamil Zbróg | 2013-11-05 22:25:17 +0000 |
commit | dfdff8db0848429266376941813cb3456b14233e (patch) | |
tree | 4330ced4b00a1fdd8793b94b0d83091b988aa32e | |
parent | 3ed4e36ee4e00802a50e04133f84bee1fc68e41d (diff) | |
download | scummvm-rg350-dfdff8db0848429266376941813cb3456b14233e.tar.gz scummvm-rg350-dfdff8db0848429266376941813cb3456b14233e.tar.bz2 scummvm-rg350-dfdff8db0848429266376941813cb3456b14233e.zip |
PRINCE: memory leak fixed in object
-rw-r--r-- | engines/prince/object.cpp | 8 | ||||
-rw-r--r-- | engines/prince/object.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/prince/object.cpp b/engines/prince/object.cpp index 9f7efcfb88..19dd7034a1 100644 --- a/engines/prince/object.cpp +++ b/engines/prince/object.cpp @@ -32,7 +32,11 @@ namespace Prince { -Object::Object() : _surface(NULL) { +Object::Object() : _surface(NULL), _x(0), _y(0), _z(0) { +} + +Object::~Object() { + delete _surface; } void Object::loadSurface(Common::SeekableReadStream &stream) { @@ -43,11 +47,9 @@ void Object::loadSurface(Common::SeekableReadStream &stream) { for (int h = 0; h < _surface->h; ++h) { stream.read(_surface->getBasePtr(0, h), _surface->w); } - } bool Object::loadFromStream(Common::SeekableReadStream &stream) { - int32 pos = stream.pos(); uint16 x = stream.readUint16LE(); if (x == 0xFFFF) diff --git a/engines/prince/object.h b/engines/prince/object.h index 2c2dbc9fbf..052b88dad6 100644 --- a/engines/prince/object.h +++ b/engines/prince/object.h @@ -31,6 +31,7 @@ namespace Prince { class Object { public: Object(); + ~Object(); bool loadFromStream(Common::SeekableReadStream &stream); Graphics::Surface *getSurface() const { return _surface; } |