aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2010-02-01 01:05:08 +0000
committerWalter van Niftrik2010-02-01 01:05:08 +0000
commitf24e0aad2b856befb84811b6fb8f6f661b605b1c (patch)
treeeb73e88d183c16d701e3cd4e2ea1da1773afc289
parent313b531d56d4accb89bcf65c72a37480c1fc052c (diff)
downloadscummvm-rg350-f24e0aad2b856befb84811b6fb8f6f661b605b1c.tar.gz
scummvm-rg350-f24e0aad2b856befb84811b6fb8f6f661b605b1c.tar.bz2
scummvm-rg350-f24e0aad2b856befb84811b6fb8f6f661b605b1c.zip
SCI: When removing audio resources from the resource manager, also remove them from the LRU list.
svn-id: r47789
-rw-r--r--engines/sci/resource.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 1f723f340a..9791402e5f 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1279,11 +1279,14 @@ void ResourceManager::removeAudioResource(ResourceId resId) {
Resource *res = _resMap.getVal(resId);
if (res->source->source_type == kSourceAudioVolume) {
- if (res->lockers == 0) {
+ if (res->status == kResStatusLocked) {
+ warning("Failed to remove resource %s (still in use)", resId.toString().c_str());
+ } else {
+ if (res->status == kResStatusEnqueued)
+ removeFromLRU(res);
+
_resMap.erase(resId);
delete res;
- } else {
- warning("Failed to remove resource %s (still in use)", resId.toString().c_str());
}
}
}