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 /engines/parallaction/graphics.h | |
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
Diffstat (limited to 'engines/parallaction/graphics.h')
-rw-r--r-- | engines/parallaction/graphics.h | 7 |
1 files changed, 5 insertions, 2 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) { |