SCI: When removing audio resources from the resource manager, also remove them from the LRU list.
svn-id: r47789
This commit is contained in:
parent
313b531d56
commit
f24e0aad2b
1 changed files with 6 additions and 3 deletions
|
@ -1279,11 +1279,14 @@ void ResourceManager::removeAudioResource(ResourceId resId) {
|
||||||
Resource *res = _resMap.getVal(resId);
|
Resource *res = _resMap.getVal(resId);
|
||||||
|
|
||||||
if (res->source->source_type == kSourceAudioVolume) {
|
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);
|
_resMap.erase(resId);
|
||||||
delete res;
|
delete res;
|
||||||
} else {
|
|
||||||
warning("Failed to remove resource %s (still in use)", resId.toString().c_str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue