Skip to content

v0.2.54..v0.2.55 changeset ScriptSchemaTranslatorFactory.cpp

Garret Voltz edited this page Aug 14, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/schema/ScriptSchemaTranslatorFactory.cpp b/hoot-core/src/main/cpp/hoot/core/schema/ScriptSchemaTranslatorFactory.cpp
index 9017176..d2dadd0 100644
--- a/hoot-core/src/main/cpp/hoot/core/schema/ScriptSchemaTranslatorFactory.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/schema/ScriptSchemaTranslatorFactory.cpp
@@ -22,7 +22,7 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
  */
 #include "ScriptSchemaTranslatorFactory.h"
 
@@ -37,19 +37,11 @@ using namespace std;
 namespace hoot
 {
 
-std::shared_ptr<ScriptSchemaTranslatorFactory> ScriptSchemaTranslatorFactory::_theInstance;
-
-ScriptSchemaTranslatorFactory::ScriptSchemaTranslatorFactory()
-{
-}
-
 ScriptSchemaTranslatorFactory& ScriptSchemaTranslatorFactory::getInstance()
 {
-  if (!_theInstance.get())
-  {
-    _theInstance.reset(new ScriptSchemaTranslatorFactory());
-  }
-  return *_theInstance;
+  //  Local static singleton instance
+  static ScriptSchemaTranslatorFactory instance;
+  return instance;
 }
 
 bool CompareSt(ScriptSchemaTranslator* st1, ScriptSchemaTranslator* st2)
Clone this wiki locally