diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-28 23:20:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-28 23:20:00 +0300 |
commit | 436abf9f8cc33dfff1fe21b8ec5e61854facbd0c (patch) | |
tree | 28383d6830cc6f5727bc5f1b4e6c8df618817557 | |
parent | d10d5deee3f67c93e8d6d2a4db437e2b6cf9ecd4 (diff) | |
download | manaplus-436abf9f8cc33dfff1fe21b8ec5e61854facbd0c.tar.gz manaplus-436abf9f8cc33dfff1fe21b8ec5e61854facbd0c.tar.bz2 manaplus-436abf9f8cc33dfff1fe21b8ec5e61854facbd0c.tar.xz manaplus-436abf9f8cc33dfff1fe21b8ec5e61854facbd0c.zip |
fix null pointer from previous commits.
-rw-r--r-- | src/resources/resourcemanager.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 9c9bb3b32..9f2947dfc 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -214,16 +214,25 @@ bool ResourceManager::cleanOrphans(const bool always) { #ifdef USE_OPENGL const Image *const image = dynamic_cast<Image*>(res); - const std::string src = image->getSource(); - if (image && image->getGLImage()) + if (image) { - logger->log("ResourceManager::release(%s, %u) %s", - res->mIdPath.c_str(), image->getGLImage(), src.c_str()); + const std::string src = image->getSource(); + if (image && image->getGLImage()) + { + logger->log("ResourceManager::release(%s, %u) %s", + res->mIdPath.c_str(), image->getGLImage(), + src.c_str()); + } + else + { + logger->log("ResourceManager::release(%s) %s", + res->mIdPath.c_str(), src.c_str()); + } } else { - logger->log("ResourceManager::release(%s) %s", - res->mIdPath.c_str(), src.c_str()); + logger->log("ResourceManager::release(%s)", + res->mIdPath.c_str()); } #else logger->log("ResourceManager::release(%s)", res->mIdPath.c_str()); |