diff options
author | Nicola Mettifogo | 2008-12-07 12:41:50 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-12-07 12:41:50 +0000 |
commit | db88c544b75daa213130092da1b4ef2d0f61ff22 (patch) | |
tree | 4c0b26a19fdf498028c01452c82854755493a0d3 | |
parent | 00de4b2b3cc878b776b64f576a8527f4f916567d (diff) | |
download | scummvm-rg350-db88c544b75daa213130092da1b4ef2d0f61ff22.tar.gz scummvm-rg350-db88c544b75daa213130092da1b4ef2d0f61ff22.tar.bz2 scummvm-rg350-db88c544b75daa213130092da1b4ef2d0f61ff22.zip |
Fixed assorted leaks in Parallaction.
svn-id: r35270
-rw-r--r-- | engines/parallaction/disk_br.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 7 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parser.h | 19 |
7 files changed, 23 insertions, 18 deletions
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index cee493f94a..4b7de5c817 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -143,12 +143,11 @@ void DosDisk_br::setLanguage(uint16 language) { DosDisk_br::DosDisk_br(Parallaction* vm) : Disk_br(vm) { } - void DosDisk_br::init() { // TODO: clarify whether the engine or OSystem should add the base game directory to the search manager. // Right now, I am keeping an internal search set to do the job. _baseDir = new Common::FSDirectory(ConfMan.get("path")); - _sset.add("base", _baseDir, 5, false); + _sset.add("base", _baseDir, 5, true); } diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 6aeb7a859f..f9fb26fcec 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -839,6 +839,8 @@ Gfx::Gfx(Parallaction* vm) : Gfx::~Gfx() { + _backBuffer.free(); + delete _backgroundInfo; freeLabels(); diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 7b92974205..51eed6a90b 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -180,7 +180,7 @@ void InventoryRenderer::showInventory() { uint16 lines = getNumLines(); Common::Point p; - _vm->_input->getCursorPos(p); + _vm->_input->getAbsoluteCursorPos(p); _pos.x = CLIP((int)(p.x - (_props->_width / 2)), 0, (int)(_vm->_screenWidth - _props->_width)); _pos.y = CLIP((int)(p.y - 2 - (lines * _props->_itemHeight)), 0, (int)(_vm->_screenHeight - lines * _props->_itemHeight)); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index d63b62cea4..f9d9265ac6 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -372,7 +372,7 @@ public: class Parallaction_ns : public Parallaction { public: - Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { } + Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc); ~Parallaction_ns(); // Engine APIs @@ -463,7 +463,7 @@ private: class Parallaction_br : public Parallaction_ns { public: - Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc) { } + Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc); ~Parallaction_br(); Common::Error init(); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 019dc1836b..15ebc219b3 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -42,6 +42,10 @@ const char *Parallaction_br::_partNames[] = { "PART4" }; +Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc), + _locationParser(0), _programParser(0) { +} + Common::Error Parallaction_br::init() { _screenWidth = 640; @@ -96,6 +100,9 @@ Common::Error Parallaction_br::init() { Parallaction_br::~Parallaction_br() { freeFonts(); + + delete _locationParser; + delete _programParser; } void Parallaction_br::callFunction(uint index, void* parm) { diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 31b27c4d5f..ff806533f1 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -141,7 +141,9 @@ void LocationName::bind(const char *s) { strcpy(_buf, s); // kept as reference } - +Parallaction_ns::Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc), + _locationParser(0), _programParser(0) { +} Common::Error Parallaction_ns::init() { diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 9c894952f2..9c7f9e3d71 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -69,7 +69,7 @@ class Parser { public: Parser() { reset(); } - ~Parser() {} + ~Parser() { reset(); } uint _lookup; @@ -216,7 +216,8 @@ protected: } public: - LocationParser_ns(Parallaction_ns *vm) : _vm(vm) { + LocationParser_ns(Parallaction_ns *vm) : _vm(vm), _commandsNames(0), _locationStmt(0), + _locationZoneStmt(0), _locationAnimStmt(0) { } virtual void init(); @@ -307,14 +308,14 @@ protected: void parseGetData(ZonePtr z); public: - LocationParser_br(Parallaction_br *vm) : LocationParser_ns((Parallaction_ns*)vm), _vm(vm) { + LocationParser_br(Parallaction_br *vm) : LocationParser_ns((Parallaction_ns*)vm), _vm(vm), + _audioCommandsNames(0) { } virtual void init(); virtual ~LocationParser_br() { - delete _commandsNames; - delete _locationStmt; + delete _audioCommandsNames; } void parse(Script *script); @@ -374,7 +375,7 @@ protected: } public: - ProgramParser_ns(Parallaction_ns *vm) : _vm(vm) { + ProgramParser_ns(Parallaction_ns *vm) : _vm(vm), _parser(0), _instructionNames(0) { } virtual void init(); @@ -412,12 +413,6 @@ public: virtual void init(); - virtual ~ProgramParser_br() { - delete _instructionNames; - delete _parser; - - } - }; |