From 5986e192171faa3f7a1422b1f8fd3e561ed5f693 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Sep 2012 03:08:30 +0300 Subject: Add source field to each resources. --- src/resources/resource.h | 8 +++++++- src/resources/resourcemanager.cpp | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/resources/resource.h b/src/resources/resource.h index d8f4a7f11..76dd71b4f 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -75,6 +75,12 @@ class Resource unsigned getRefCount() const { return mRefCount; } + void setSource(const std::string str) + { mSource = str; } + + std::string getSource() const + { return mSource; } + #ifdef DEBUG_DUMP_LEAKS bool getDumped() const { return mDumped; } @@ -94,7 +100,7 @@ class Resource private: time_t mTimeStamp; /**< Time at which the resource was orphaned. */ unsigned mRefCount; /**< Reference count. */ - std::string mName; + std::string mSource; #ifdef DEBUG_DUMP_LEAKS bool mDumped; #endif diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 7d80e8bcc..f398c4b45 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -214,15 +214,16 @@ bool ResourceManager::cleanOrphans(const bool always) { #ifdef USE_OPENGL const Image *const image = dynamic_cast(res); + const std::string src = image->getSource(); if (image && image->getGLImage()) { - logger->log("ResourceManager::release(%s, %u)", - res->mIdPath.c_str(), image->getGLImage()); + logger->log("ResourceManager::release(%s, %u) %s", + res->mIdPath.c_str(), image->getGLImage(), src.c_str()); } else { - logger->log("ResourceManager::release(%s)", - res->mIdPath.c_str()); + logger->log("ResourceManager::release(%s) %s", + res->mIdPath.c_str(), src.c_str()); } #else logger->log("ResourceManager::release(%s)", res->mIdPath.c_str()); -- cgit v1.2.3-70-g09d2