summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index bec7914fc..50d6ccb6d 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -58,6 +58,7 @@
#include "debug.h"
+ResourceManager *resourceManager = nullptr;
ResourceManager *ResourceManager::instance = nullptr;
ResourceManager::ResourceManager() :
@@ -171,6 +172,12 @@ ResourceManager::~ResourceManager()
clearScheduled();
}
+void ResourceManager::init()
+{
+ if (!resourceManager)
+ resourceManager = new ResourceManager;
+}
+
void ResourceManager::cleanUp(Resource *const res)
{
if (!res)
@@ -949,10 +956,7 @@ void ResourceManager::decRefDelete(Resource *const res)
ResourceManager *ResourceManager::getInstance()
{
- // Create a new instance if necessary.
- if (!instance)
- instance = new ResourceManager;
- return instance;
+ return resourceManager;
}
void ResourceManager::deleteInstance()