[Scummvm-cvs-logs] scummvm master -> b6dd53072446fa967edb03d34044a9054ea1fa56
eriktorbjorn
eriktorbjorn at telia.com
Tue Jun 14 23:58:03 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b6dd530724 SCUMM: Fix noisy Valgrind warning.
Commit: b6dd53072446fa967edb03d34044a9054ea1fa56
https://github.com/scummvm/scummvm/commit/b6dd53072446fa967edb03d34044a9054ea1fa56
Author: eriktorbjorn (eriktorbjorn at users.sourceforge.net)
Date: 2011-06-14T14:55:57-07:00
Commit Message:
SCUMM: Fix noisy Valgrind warning.
Changed paths:
engines/scumm/resource.cpp
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 0448f60..10301da 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -822,11 +822,12 @@ byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) {
expireResources(size);
- byte *ptr = (byte *)calloc(size + SAFETY_AREA, 1);
+ byte *ptr = new byte[size + SAFETY_AREA];
if (ptr == NULL) {
error("createResource(%s,%d): Out of memory while allocating %d", nameOfResType(type), idx, size);
}
+ memset(ptr, 0, size + SAFETY_AREA);
_allocatedSize += size;
_types[type][idx]._address = ptr;
@@ -845,12 +846,12 @@ ResourceManager::Resource::Resource() {
}
ResourceManager::Resource::~Resource() {
- delete _address;
+ delete[] _address;
_address = 0;
}
void ResourceManager::Resource::nuke() {
- delete _address;
+ delete[] _address;
_address = 0;
_size = 0;
_flags = 0;
More information about the Scummvm-git-logs
mailing list