diff options
author | Nicola Mettifogo | 2008-08-31 10:43:32 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-08-31 10:43:32 +0000 |
commit | ccf88578c808cf7a4f53d3f284c9db7074064b67 (patch) | |
tree | 9cee790e0c1c6c170983235ba08968aee6c5dad7 | |
parent | 4cda7abda198296f890326483cc694e35e76d263 (diff) | |
download | scummvm-rg350-ccf88578c808cf7a4f53d3f284c9db7074064b67.tar.gz scummvm-rg350-ccf88578c808cf7a4f53d3f284c9db7074064b67.tar.bz2 scummvm-rg350-ccf88578c808cf7a4f53d3f284c9db7074064b67.zip |
Fixed leak with Input class, introduced in commit 34206.
svn-id: r34224
-rw-r--r-- | engines/parallaction/graphics.h | 7 | ||||
-rw-r--r-- | engines/parallaction/input.cpp | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 497152c08c..ac9f096d7e 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -313,6 +313,7 @@ struct Cnv : public Frames { uint16 _height; // byte** field_8; // unused byte* _data; + bool _freeData; public: Cnv() { @@ -320,12 +321,14 @@ public: _data = NULL; } - Cnv(uint16 numFrames, uint16 width, uint16 height, byte* data) : _count(numFrames), _width(width), _height(height), _data(data) { + Cnv(uint16 numFrames, uint16 width, uint16 height, byte* data, bool freeData = false) + : _count(numFrames), _width(width), _height(height), _data(data), _freeData(freeData) { } ~Cnv() { - free(_data); + if (_freeData) + free(_data); } byte* getFramePtr(uint16 index) { diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index c14c512a26..98198b88f7 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -421,10 +421,12 @@ bool Input::isMouseEnabled() { void Input::initCursors() { + _dinoCursor = _donnaCursor = _dougCursor = 0; + switch (_gameType) { case GType_Nippon: _comboArrow = _vm->_disk->loadPointer("pointer"); - _mouseArrow = new Cnv(1, MOUSEARROW_WIDTH_NS, MOUSEARROW_HEIGHT_NS, _resMouseArrow_NS); + _mouseArrow = new Cnv(1, MOUSEARROW_WIDTH_NS, MOUSEARROW_HEIGHT_NS, _resMouseArrow_NS, false); break; case GType_BRA: |