mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
SCI: Plug a leak in ResourceManager::detectSciVersion()
Many thanks to digitall for finding this one
This commit is contained in:
parent
cdb6cf687f
commit
780b2eff16
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user