aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2008-12-07 14:33:30 +0000
committerNicola Mettifogo2008-12-07 14:33:30 +0000
commit6ecc17010d354bb1dbfebd58ff1bc70c2ce61e67 (patch)
tree647692ad28f155021b66d47da6a69de3ef03c27f /engines/parallaction
parent3de7a31dc18547167364967f1a33e3b03f555e58 (diff)
downloadscummvm-rg350-6ecc17010d354bb1dbfebd58ff1bc70c2ce61e67.tar.gz
scummvm-rg350-6ecc17010d354bb1dbfebd58ff1bc70c2ce61e67.tar.bz2
scummvm-rg350-6ecc17010d354bb1dbfebd58ff1bc70c2ce61e67.zip
Fixed some more leaks and mismatched allocations/deallocations.
svn-id: r35277
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/disk_ns.cpp7
-rw-r--r--engines/parallaction/graphics.h2
-rw-r--r--engines/parallaction/objects.cpp4
3 files changed, 9 insertions, 4 deletions
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index bd6c151cf1..2533d32d7c 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -283,7 +283,7 @@ Cnv* DosDisk_ns::loadExternalCnv(const char *filename) {
uint16 height = stream->readByte();
uint32 decsize = numFrames * width * height;
- byte *data = (byte*)malloc(decsize);
+ byte *data = new byte[decsize];
stream->read(data, decsize);
delete stream;
@@ -299,7 +299,7 @@ Frames* DosDisk_ns::loadCnv(const char *filename) {
uint16 width = stream->readByte();
uint16 height = stream->readByte();
uint32 decsize = numFrames * width * height;
- byte *data = (byte*)malloc(decsize);
+ byte *data = new byte[decsize];
Graphics::PackBitsReadStream decoder(*stream);
decoder.read(data, decsize);
@@ -836,7 +836,8 @@ Cnv* AmigaDisk_ns::makeCnv(Common::SeekableReadStream *stream, bool disposeStrea
stream->read(buf, rawsize);
uint32 decsize = numFrames * width * height;
- byte *data = (byte*)calloc(decsize, 1);
+ byte *data = new byte[decsize];
+ memset(data, 0, decsize);
unpackBitmap(data, buf, numFrames, bytesPerPlane, height);
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 9b2cfdf479..1c540e914e 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -287,7 +287,7 @@ public:
~Cnv() {
if (_freeData)
- free(_data);
+ delete []_data;
}
byte* getFramePtr(uint16 index) {
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 54a5c6c533..a75620e26e 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -201,6 +201,10 @@ Zone::~Zone() {
case kZoneMerge:
delete u.merge;
break;
+
+ case kZonePath:
+ delete u.path;
+ break;
default:
break;