diff options
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/resource.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 8eb41ecdfb..10f28516b3 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -535,6 +535,10 @@ void ResourceManager::allocResTypeData(ResType type, uint32 tag, int num, ResTyp _types[type]._mode = mode; _types[type]._tag = tag; + + // If there was data in there, let's clear it out completely. This is important + // in case we are restarting the game. + _types[type]._resources.clear(); _types[type]._resources.resize(num); /* diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 3ebacee6a5..6e958462b2 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2447,13 +2447,6 @@ void ScummEngine::restart() { for (i = 1; i < _numGlobalObjects; i++) clearOwnerOf(i); - // Reallocate arrays - // FIXME: This should already be called by readIndexFile. - // FIXME: regardless of that, allocateArrays and allocResTypeData leaks - // heavily, which should be fixed. - allocateArrays(); - - // Reread index (reset objectstate etc) readIndexFile(); // Reinit scumm variables |