aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-04-23 11:36:06 +0000
committerTorbjörn Andersson2004-04-23 11:36:06 +0000
commit0ac8c4bd3f87399856ed0b5549877c01cd6d3506 (patch)
tree44bed73836c4517cfb7939e248f523d2b50e047b /sword2
parent729ccc0ac79d35fbfb947f31141dd85a60f613ce (diff)
downloadscummvm-rg350-0ac8c4bd3f87399856ed0b5549877c01cd6d3506.tar.gz
scummvm-rg350-0ac8c4bd3f87399856ed0b5549877c01cd6d3506.tar.bz2
scummvm-rg350-0ac8c4bd3f87399856ed0b5549877c01cd6d3506.zip
I forgot to clear the reference counter when a resource is forcibly removed
and I may as well clear it when a resource is read from disk as well. svn-id: r13606
Diffstat (limited to 'sword2')
-rw-r--r--sword2/resman.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index c807a6025a..245f9819dd 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -463,6 +463,7 @@ byte *ResourceManager::openResource(uint32 res, bool dump) {
// If it can't then old files will be ditched until it works.
_resList[res].ptr = _vm->_memory->memAlloc(len, res);
_resList[res].size = len;
+ _resList[res].refCount = 0;
file.read(_resList[res].ptr, len);
@@ -746,6 +747,7 @@ void ResourceManager::remove(int res) {
if (_resList[res].ptr) {
_vm->_memory->memFree(_resList[res].ptr);
_resList[res].ptr = NULL;
+ _resList[res].refCount = 0;
}
}