diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-29 17:05:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-29 17:05:07 +0300 |
commit | cb578a13379c828cfa02032ceab03a7dcbdb1c97 (patch) | |
tree | f98bc8b7af3e5949c0dc481094640aef7ad9f3e2 | |
parent | 1b11cc3a6d58908c38ca9f31bfd650bdac41d93b (diff) | |
download | plus-cb578a13379c828cfa02032ceab03a7dcbdb1c97.tar.gz plus-cb578a13379c828cfa02032ceab03a7dcbdb1c97.tar.bz2 plus-cb578a13379c828cfa02032ceab03a7dcbdb1c97.tar.xz plus-cb578a13379c828cfa02032ceab03a7dcbdb1c97.zip |
Remove variable ResourceManager::instance.
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 13 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.h | 1 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index ef6ac3a12..89e9a8bc6 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -48,7 +48,6 @@ #include "debug.h" ResourceManager *resourceManager = nullptr; -ResourceManager *ResourceManager::instance = nullptr; ResourceManager::ResourceManager() : deletedSurfaces(), @@ -624,16 +623,16 @@ void ResourceManager::decRefDelete(Resource *const res) void ResourceManager::deleteInstance() { #ifdef DUMP_LEAKED_RESOURCES - if (instance) + if (resourceManager) { logger->log1("clean orphans start"); - instance->cleanProtected(); - while (instance->cleanOrphans(true)) + resourceManager->cleanProtected(); + while (resourceManager->cleanOrphans(true)) continue; logger->log1("clean orphans end"); - ResourceIterator iter = instance->mResources.begin(); + ResourceIterator iter = resourceManager->mResources.begin(); - while (iter != instance->mResources.end()) + while (iter != resourceManager->mResources.end()) { const Resource *const res = iter->second; if (res) @@ -649,7 +648,7 @@ void ResourceManager::deleteInstance() } } #endif - delete2(instance); + delete2(resourceManager); } void ResourceManager::scheduleDelete(SDL_Surface *const surface) diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h index c1e55355b..6d2f12b37 100644 --- a/src/resources/resourcemanager/resourcemanager.h +++ b/src/resources/resourcemanager/resourcemanager.h @@ -191,7 +191,6 @@ class ResourceManager final : public MemoryCounter static void logResource(const Resource *const res); - static ResourceManager *instance; std::set<SDL_Surface*> deletedSurfaces; Resources mResources; Resources mOrphanedResources; |