aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-01-29 23:48:46 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:46 +0100
commit2f2d371dbda69a3a364cd875c8181b072bcd7aeb (patch)
tree8fb1b9aa64d64c726c38f8173d302ed35df60c63
parent0a40534c340170a9ddfc18bd82c932e054d06321 (diff)
downloadusdx-2f2d371dbda69a3a364cd875c8181b072bcd7aeb.tar.gz
usdx-2f2d371dbda69a3a364cd875c8181b072bcd7aeb.tar.xz
usdx-2f2d371dbda69a3a364cd875c8181b072bcd7aeb.zip
made singletons reusable
set instance variable to NULL on deletion of singleton, so that it is reconstructed before next usage
-rw-r--r--src/base/language.cpp3
-rw-r--r--src/base/songloading/songloader.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/base/language.cpp b/src/base/language.cpp
index 121f17c2..340cdac4 100644
--- a/src/base/language.cpp
+++ b/src/base/language.cpp
@@ -52,6 +52,9 @@ namespace usdx
Language::~Language(void)
{
+
+ // remove reference from singleton to make regeneration possible
+ instance = NULL;
}
Language* Language::get_instance(void)
diff --git a/src/base/songloading/songloader.cpp b/src/base/songloading/songloader.cpp
index c5c595d4..b86f3100 100644
--- a/src/base/songloading/songloader.cpp
+++ b/src/base/songloading/songloader.cpp
@@ -51,6 +51,9 @@ namespace usdx
}
strategies.clear();
+
+ // remove reference from singleton to make regeneration possible
+ instance = NULL;
}
Songloader *Songloader::get_instance(void)