[Scummvm-cvs-logs] SF.net SVN: scummvm:[35277] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Dec 7 15:33:30 CET 2008
Revision: 35277
http://scummvm.svn.sourceforge.net/scummvm/?rev=35277&view=rev
Author: peres001
Date: 2008-12-07 14:33:30 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
Fixed some more leaks and mismatched allocations/deallocations.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk_ns.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/objects.cpp
Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp 2008-12-07 14:24:46 UTC (rev 35276)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp 2008-12-07 14:33:30 UTC (rev 35277)
@@ -283,7 +283,7 @@
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 @@
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 @@
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);
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2008-12-07 14:24:46 UTC (rev 35276)
+++ scummvm/trunk/engines/parallaction/graphics.h 2008-12-07 14:33:30 UTC (rev 35277)
@@ -287,7 +287,7 @@
~Cnv() {
if (_freeData)
- free(_data);
+ delete []_data;
}
byte* getFramePtr(uint16 index) {
Modified: scummvm/trunk/engines/parallaction/objects.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/objects.cpp 2008-12-07 14:24:46 UTC (rev 35276)
+++ scummvm/trunk/engines/parallaction/objects.cpp 2008-12-07 14:33:30 UTC (rev 35277)
@@ -201,6 +201,10 @@
case kZoneMerge:
delete u.merge;
break;
+
+ case kZonePath:
+ delete u.path;
+ break;
default:
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list