diff options
author | Henri Herscher <henri@oreka.org> | 2006-07-11 18:56:16 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2006-07-11 18:56:16 +0000 |
commit | 90f521dfe34909672ebfead5ef2ba87742c33cdd (patch) | |
tree | 6dd70490a64081eba6dde4daf9d1ff3c7eee99aa | |
parent | e88b6fb3ba37a5c7547f415c13a2053d8d5c32fc (diff) |
Make sure the singleton cannot be instanciated twice
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@298 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r-- | orkaudio/BatchProcessing.cpp | 7 | ||||
-rw-r--r-- | orkaudio/Reporting.cpp | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/orkaudio/BatchProcessing.cpp b/orkaudio/BatchProcessing.cpp index 31439af..78cbf9a 100644 --- a/orkaudio/BatchProcessing.cpp +++ b/orkaudio/BatchProcessing.cpp @@ -25,8 +25,11 @@ TapeProcessorRef BatchProcessing::m_singleton; void BatchProcessing::Initialize() { - m_singleton.reset(new BatchProcessing()); - TapeProcessorRegistry::instance()->RegisterTapeProcessor(m_singleton); + if(m_singleton.get == NULL) + { + m_singleton.reset(new BatchProcessing()); + TapeProcessorRegistry::instance()->RegisterTapeProcessor(m_singleton); + } } diff --git a/orkaudio/Reporting.cpp b/orkaudio/Reporting.cpp index f03a22c..5d2f7ec 100644 --- a/orkaudio/Reporting.cpp +++ b/orkaudio/Reporting.cpp @@ -27,8 +27,11 @@ TapeProcessorRef Reporting::m_singleton; void Reporting::Initialize() { - m_singleton.reset(new Reporting()); - TapeProcessorRegistry::instance()->RegisterTapeProcessor(m_singleton); + if(m_singleton.get() == NULL) + { + m_singleton.reset(new Reporting()); + TapeProcessorRegistry::instance()->RegisterTapeProcessor(m_singleton); + } } Reporting* Reporting::Instance() |