diff options
author | Johannes Schickel | 2009-05-25 12:47:58 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-05-25 12:47:58 +0000 |
commit | cb5c26dd53d749e355ab30209a81a89fa9289eba (patch) | |
tree | 559e7ec36eaf063b3647198d4e51e0e75dd72a39 | |
parent | c7d9e4dc0c5db02288bfc3d274f469e394e6b288 (diff) | |
download | scummvm-rg350-cb5c26dd53d749e355ab30209a81a89fa9289eba.tar.gz scummvm-rg350-cb5c26dd53d749e355ab30209a81a89fa9289eba.tar.bz2 scummvm-rg350-cb5c26dd53d749e355ab30209a81a89fa9289eba.zip |
- Fix various valgrind warnings in the audio sync code
- Fix crash when qutting KQ 5 CD
(It was caused by resources of type "kResourceTypeSync" getting allocated an "Resource" object instead of an "ResourceSync" object, I hope this is the correct fix)
svn-id: r40888
-rw-r--r-- | engines/sci/resource.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index dd9e5f54fd..c9faaf0231 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -985,7 +985,15 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) { resId = RESOURCE_HASH(type, number); // adding new resource only if it does not exist if (_resMap.contains(resId) == false) { - res = new Resource; + switch (type) { + case kResourceTypeSync: + res = new ResourceSync; + break; + default: + res = new Resource; + break; + } + _resMap.setVal(resId, res); res->type = (ResourceType)type; res->number = number; |