summaryrefslogtreecommitdiffstats
path: root/api/logic/Env.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/Env.cpp')
-rw-r--r--api/logic/Env.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/api/logic/Env.cpp b/api/logic/Env.cpp
index b769c9c4..a6341ebd 100644
--- a/api/logic/Env.cpp
+++ b/api/logic/Env.cpp
@@ -22,6 +22,8 @@ public:
QString m_wonkoRootUrl;
};
+static Env * instance;
+
/*
* The *NEW* global rat nest of an object. Handle with care.
*/
@@ -38,8 +40,17 @@ Env::~Env()
Env& Env::Env::getInstance()
{
- static Env instance;
- return instance;
+ if(!instance)
+ {
+ instance = new Env();
+ }
+ return *instance;
+}
+
+void Env::dispose()
+{
+ delete instance;
+ instance = nullptr;
}
shared_qobject_ptr< HttpMetaCache > Env::metacache()