From ccf88578c808cf7a4f53d3f284c9db7074064b67 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Sun, 31 Aug 2008 10:43:32 +0000 Subject: Fixed leak with Input class, introduced in commit 34206. svn-id: r34224 --- engines/parallaction/graphics.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/parallaction/graphics.h') 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) { -- cgit v1.2.3