aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/toltecs/resource.cpp')
-rw-r--r--engines/toltecs/resource.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/toltecs/resource.cpp b/engines/toltecs/resource.cpp
index 62dbca3141..e1e3cb9ac7 100644
--- a/engines/toltecs/resource.cpp
+++ b/engines/toltecs/resource.cpp
@@ -90,7 +90,17 @@ ResourceCache::ResourceCache(ToltecsEngine *vm) : _vm(vm) {
}
ResourceCache::~ResourceCache() {
- // TODO: Delete resources
+ purgeCache();
+}
+
+void ResourceCache::purgeCache() {
+ for (ResourceMap::iterator iter = _cache.begin(); iter != _cache.end(); ++iter) {
+ delete[] iter->_value->data;
+ delete iter->_value;
+ iter->_value = 0;
+ }
+
+ _cache.clear();
}
Resource *ResourceCache::load(uint resIndex) {