diff options
author | David Turner | 2010-11-10 06:22:18 +0000 |
---|---|---|
committer | David Turner | 2010-11-10 06:22:18 +0000 |
commit | 52ecbd4305d2f728ea8db11dab28e9a56c9dcb6e (patch) | |
tree | c8d08f83e8014acfe70ac4f4798a8856d7e21624 /engines/toon/hotspot.cpp | |
parent | 7ad677afc8ad3768a8c903afed5881403e1a026d (diff) | |
download | scummvm-rg350-52ecbd4305d2f728ea8db11dab28e9a56c9dcb6e.tar.gz scummvm-rg350-52ecbd4305d2f728ea8db11dab28e9a56c9dcb6e.tar.bz2 scummvm-rg350-52ecbd4305d2f728ea8db11dab28e9a56c9dcb6e.zip |
TOON: Even more corrections to close memory leaks.
These corrections close a number of leaks in the Toon engine reported by running Valgrind with --leak-check=full option, but a few still remain.
svn-id: r54185
Diffstat (limited to 'engines/toon/hotspot.cpp')
-rw-r--r-- | engines/toon/hotspot.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp index 782e49c2d5..687ea6ee83 100644 --- a/engines/toon/hotspot.cpp +++ b/engines/toon/hotspot.cpp @@ -29,11 +29,12 @@ namespace Toon { Hotspots::Hotspots(ToonEngine *vm) : _vm(vm) { - _items = 0; + _items = NULL; _numItems = 0; } Hotspots::~Hotspots() { + delete[] _items; } void Hotspots::load(Common::ReadStream *Stream) { @@ -49,7 +50,6 @@ void Hotspots::load(Common::ReadStream *Stream) { } void Hotspots::save(Common::WriteStream *Stream) { - Stream->writeSint16BE(_numItems); for (int32 i = 0; i < _numItems; i++) { @@ -123,9 +123,7 @@ bool Hotspots::LoadRif(Common::String rifName, Common::String additionalRifName) _numItems = (rifsize + rifsize2) / 512; - if (_items) - delete[] _items; - + delete[] _items; _items = new HotspotData[_numItems]; // RIFs are compressed in RNC1 |