aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2012-01-15 18:34:41 +0200
committerFilippos Karapetis2012-01-15 18:34:41 +0200
commit780b2eff1636985b900db6d0908cc6d3d395f409 (patch)
tree032df8e360e89f0480ff8704b44fffe64b48dbf6 /engines/sci/resource.cpp
parentcdb6cf687fbeb9365dc75dc5fc92ad17fea8f2e3 (diff)
downloadscummvm-rg350-780b2eff1636985b900db6d0908cc6d3d395f409.tar.gz
scummvm-rg350-780b2eff1636985b900db6d0908cc6d3d395f409.tar.bz2
scummvm-rg350-780b2eff1636985b900db6d0908cc6d3d395f409.zip
SCI: Plug a leak in ResourceManager::detectSciVersion()
Many thanks to digitall for finding this one
Diffstat (limited to 'engines/sci/resource.cpp')
-rw-r--r--engines/sci/resource.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 9171e5e5d9..c3bd03bac3 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -2200,13 +2200,16 @@ void ResourceManager::detectSciVersion() {
// Handle SCI32 versions here
if (_volVersion >= kResVersionSci2) {
Common::List<ResourceId> *heaps = listResources(kResourceTypeHeap);
+ bool hasHeapResources = !heaps->empty();
+ delete heaps;
+
// SCI2.1/3 and SCI1 Late resource maps are the same, except that
// SCI1 Late resource maps have the resource types or'd with
// 0x80. We differentiate between SCI2 and SCI2.1/3 based on that.
if (_mapVersion == kResVersionSci1Late) {
s_sciVersion = SCI_VERSION_2;
return;
- } else if (!heaps->empty()) {
+ } else if (hasHeapResources) {
s_sciVersion = SCI_VERSION_2_1;
return;
} else {