aboutsummaryrefslogtreecommitdiff
path: root/sword1/resman.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2004-11-19 07:55:33 +0000
committerRobert Göffringmann2004-11-19 07:55:33 +0000
commit0bda71fa39dec43d9f9e259a57bd958622c2fc2f (patch)
tree28ae9d16766114c590dc6213e4750b567a3d6f85 /sword1/resman.cpp
parentd173491acc2133497bc22b9728686b6b997ae505 (diff)
downloadscummvm-rg350-0bda71fa39dec43d9f9e259a57bd958622c2fc2f.tar.gz
scummvm-rg350-0bda71fa39dec43d9f9e259a57bd958622c2fc2f.tar.bz2
scummvm-rg350-0bda71fa39dec43d9f9e259a57bd958622c2fc2f.zip
a little cleanup
svn-id: r15832
Diffstat (limited to 'sword1/resman.cpp')
-rw-r--r--sword1/resman.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/sword1/resman.cpp b/sword1/resman.cpp
index ecb53ffe0b..63cb31409c 100644
--- a/sword1/resman.cpp
+++ b/sword1/resman.cpp
@@ -46,8 +46,8 @@ namespace Sword1 {
#define MAX_PATH_LEN 260
-ResMan::ResMan(const char *resFile, MemMan *pMemoMan) {
- _memMan = pMemoMan;
+ResMan::ResMan(const char *resFile) {
+ _memMan = new MemMan();
loadCluDescript(resFile);
}
@@ -71,7 +71,9 @@ ResMan::~ResMan(void) {
}
debug(0, "ResMan closed\n");
#endif
+ flush();
freeCluDescript();
+ delete _memMan;
}
void ResMan::loadCluDescript(const char *fileName) {
@@ -165,6 +167,8 @@ void ResMan::flush(void) {
_memMan->setCondition(group->resHandle + resCnt, MEM_CAN_FREE);
group->resHandle[resCnt].refCount = 0;
}
+ // the memory manager cached the blocks we asked it to free, so explicitly make it free them
+ _memMan->flush();
}
void *ResMan::fetchRes(uint32 id) {