diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/emotedb.cpp | 18 | ||||
-rw-r--r-- | src/resources/imagehelper.cpp | 11 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 9 |
3 files changed, 22 insertions, 16 deletions
diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index b3628cdeb..a8e8b434f 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -181,11 +181,12 @@ void EmoteDB::unload() { if (i->second) { - while (!i->second->sprites.empty()) + std::list<EmoteSprite*> &sprites = i->second->sprites; + while (!sprites.empty()) { - delete i->second->sprites.front()->sprite; - delete i->second->sprites.front(); - i->second->sprites.pop_front(); + delete sprites.front()->sprite; + delete sprites.front(); + sprites.pop_front(); } delete i->second; } @@ -193,11 +194,12 @@ void EmoteDB::unload() mEmoteInfos.clear(); - while (!mUnknown.sprites.empty()) + std::list<EmoteSprite*> &sprites = mUnknown.sprites; + while (!sprites.empty()) { - delete mUnknown.sprites.front()->sprite; - delete mUnknown.sprites.front(); - mUnknown.sprites.pop_front(); + delete sprites.front()->sprite; + delete sprites.front(); + sprites.pop_front(); } mLoaded = false; diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index a70889acd..4762d42e0 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -105,10 +105,13 @@ void ImageHelper::dumpSurfaceFormat(SDL_Surface *image) const SDL_PixelFormat * const format = image->format; logger->log("Bytes per pixel: %d", format->BytesPerPixel); logger->log("Alpha: %d", format->alpha); - logger->log("Loss: %02x, %02x, %02x, %02x", (int)format->Rloss, - (int)format->Gloss, (int)format->Bloss, (int)format->Aloss); - logger->log("Shift: %02x, %02x, %02x, %02x", (int)format->Rshift, - (int)format->Gshift, (int)format->Bshift, (int)format->Ashift); + logger->log("Loss: %02x, %02x, %02x, %02x", + static_cast<int>(format->Rloss), static_cast<int>(format->Gloss), + static_cast<int>(format->Bloss), static_cast<int>(format->Aloss)); + logger->log("Shift: %02x, %02x, %02x, %02x", + static_cast<int>(format->Rshift), static_cast<int>(format->Gshift), + static_cast<int>(format->Bshift), + static_cast<int>(format->Ashift)); logger->log("Mask: %08x, %08x, %08x, %08x", format->Rmask, format->Gmask, format->Bmask, format->Amask); } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 8b9c4e3c0..5b4feb08f 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -688,12 +688,13 @@ void ResourceManager::deleteInstance() while (iter != instance->mResources.end()) { - if (iter->second) + Resource *res = iter->second; + if (res) { - if (iter->second->getRefCount()) + if (res->getRefCount()) { - logger->log("ResourceLeak: " + iter->second->getIdPath() - + " (" + toString(iter->second->getRefCount()) + ")"); + logger->log("ResourceLeak: " + res->getIdPath() + + " (" + toString(res->getRefCount()) + ")"); } } ++iter; |