aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/staticres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/staticres.cpp')
-rw-r--r--engines/kyra/staticres.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 88bc2e984c..d12c918b12 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -603,13 +603,15 @@ bool StaticResource::prefetchId(int id) {
void StaticResource::unloadId(int id) {
Common::List<ResData>::iterator pos = _resList.begin();
- for (; pos != _resList.end(); ++pos) {
+ for (; pos != _resList.end();) {
if (pos->id == id || id == -1) {
const FileType *filetype = getFiletype(pos->type);
(this->*(filetype->free))(pos->data, pos->size);
pos = _resList.erase(pos);
if (id != -1)
break;
+ } else {
+ ++pos;
}
}
}