diff options
author | Eugene Sandulenko | 2016-03-06 01:37:03 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-03-06 01:37:03 +0100 |
commit | fe7332cb181368ab18fd05125bf64f50fa912919 (patch) | |
tree | 3472bc6f63b8c6fc6bceeca1f33ae7a1f18b6fff | |
parent | ca630653f80ecd14d107a19e450898bcb2f1b937 (diff) | |
parent | 9515d07f003854ee4816a56b9b2a709aafc8fdf0 (diff) | |
download | scummvm-rg350-fe7332cb181368ab18fd05125bf64f50fa912919.tar.gz scummvm-rg350-fe7332cb181368ab18fd05125bf64f50fa912919.tar.bz2 scummvm-rg350-fe7332cb181368ab18fd05125bf64f50fa912919.zip |
Merge pull request #689 from Tkachov/master
SWORD25: Fix "Resource not released" warnings
-rw-r--r-- | engines/sword25/gfx/animationresource.cpp | 5 | ||||
-rw-r--r-- | engines/sword25/gfx/fontresource.cpp | 5 | ||||
-rw-r--r-- | engines/sword25/gfx/text.cpp | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index 431d466658..423a2b86b4 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -211,8 +211,9 @@ bool AnimationResource::precacheAllFrames() const { error("Could not precache \"%s\".", (*iter).fileName.c_str()); return false; } -#else - Kernel::getInstance()->getResourceManager()->requestResource((*iter).fileName); +#else + Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource((*iter).fileName); + pResource->release(); //unlock precached resource #endif } diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp index c4d4c3c52e..1d7aedcb6e 100644 --- a/engines/sword25/gfx/fontresource.cpp +++ b/engines/sword25/gfx/fontresource.cpp @@ -103,8 +103,9 @@ bool FontResource::parserCallback_font(ParserNode *node) { if (!_pKernel->getResourceManager()->precacheResource(_bitmapFileName)) { error("Could not precache \"%s\".", _bitmapFileName.c_str()); } -#else - _pKernel->getResourceManager()->requestResource(_bitmapFileName); +#else + Resource *pResource = _pKernel->getResourceManager()->requestResource(_bitmapFileName); + pResource->release(); //unlock precached resource #endif return true; diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index d409c538c0..769c9b1162 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -77,7 +77,8 @@ bool Text::setFont(const Common::String &font) { return false; } #else - getResourceManager()->requestResource(font); + Resource *pResource = getResourceManager()->requestResource(font); + pResource->release(); //unlock precached resource _font = font; updateFormat(); forceRefresh(); |