From cb578a13379c828cfa02032ceab03a7dcbdb1c97 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 29 Aug 2016 17:05:07 +0300 Subject: Remove variable ResourceManager::instance. --- src/resources/resourcemanager/resourcemanager.cpp | 13 ++++++------- 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 deletedSurfaces; Resources mResources; Resources mOrphanedResources; -- cgit v1.2.3-70-g09d2