Index: code/branches/objecthierarchy2/src/core/Core.cc
===================================================================
--- code/branches/objecthierarchy2/src/core/Core.cc	(revision 2172)
+++ code/branches/objecthierarchy2/src/core/Core.cc	(revision 2344)
@@ -46,4 +46,6 @@
     bool Core::bIsMaster_s      = false;
 
+    Core* Core::singletonRef_s = 0;
+
     /**
         @brief Constructor: Registers the object and sets the config-values.
@@ -53,6 +55,9 @@
     {
         RegisterRootObject(Core);
+
+        assert(singletonRef_s == 0);
+        singletonRef_s = this;
+
         this->setConfigValues();
-        isCreatingCoreSettings() = false;
     }
 
@@ -62,35 +67,6 @@
     Core::~Core()
     {
-        isCreatingCoreSettings() = true;
-    }
-
-    /**
-        @brief Returns true if the Core instance is not yet ready and the static functions have to return a default value.
-    */
-    bool& Core::isCreatingCoreSettings()
-    {
-        static bool bCreatingCoreSettings = true;
-        return bCreatingCoreSettings;
-    }
-
-    /**
-        @brief Returns a unique instance of Core.
-        @return The instance
-    */
-    Core& Core::getInstance()
-    {
-        // If bCreatingSoftDebugLevelObject is true, we're just about to create an instance of the DebugLevel class
-        //if (Core::isCreatingCoreSettings())
-        //{
-        //    isCreatingCoreSettings() = false;
-        //    //instance.setConfigValues();
-        //}
-
-        static bool firstTime = true;
-        if (firstTime)
-            isCreatingCoreSettings() = true;
-
-        static Core instance;
-        return instance;
+        assert(singletonRef_s);
+        singletonRef_s = 0;
     }
 
@@ -140,23 +116,18 @@
     int Core::getSoftDebugLevel(OutputHandler::OutputDevice device)
     {
-        if (!Core::isCreatingCoreSettings())
+        switch (device)
         {
-            switch (device)
-            {
-            case OutputHandler::LD_All:
-                return Core::getInstance().softDebugLevel_;
-            case OutputHandler::LD_Console:
-                return Core::getInstance().softDebugLevelConsole_;
-            case OutputHandler::LD_Logfile:
-                return Core::getInstance().softDebugLevelLogfile_;
-            case OutputHandler::LD_Shell:
-                return Core::getInstance().softDebugLevelShell_;
-            default:
-                assert(0);
-            }
+        case OutputHandler::LD_All:
+            return Core::getInstance().softDebugLevel_;
+        case OutputHandler::LD_Console:
+            return Core::getInstance().softDebugLevelConsole_;
+        case OutputHandler::LD_Logfile:
+            return Core::getInstance().softDebugLevelLogfile_;
+        case OutputHandler::LD_Shell:
+            return Core::getInstance().softDebugLevelShell_;
+        default:
+            assert(0);
+            return 2;
         }
-
-        // Return a constant value while we're creating the object
-        return 2;
     }
 
@@ -168,17 +139,14 @@
      void Core::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
      {
-        if (!Core::isCreatingCoreSettings())
-        {
-            if (device == OutputHandler::LD_All)
-                Core::getInstance().softDebugLevel_ = level;
-            else if (device == OutputHandler::LD_Console)
-                Core::getInstance().softDebugLevelConsole_ = level;
-            else if (device == OutputHandler::LD_Logfile)
-                Core::getInstance().softDebugLevelLogfile_ = level;
-            else if (device == OutputHandler::LD_Shell)
-                Core::getInstance().softDebugLevelShell_ = level;
+        if (device == OutputHandler::LD_All)
+            Core::getInstance().softDebugLevel_ = level;
+        else if (device == OutputHandler::LD_Console)
+            Core::getInstance().softDebugLevelConsole_ = level;
+        else if (device == OutputHandler::LD_Logfile)
+            Core::getInstance().softDebugLevelLogfile_ = level;
+        else if (device == OutputHandler::LD_Shell)
+            Core::getInstance().softDebugLevelShell_ = level;
 
-            OutputHandler::setSoftDebugLevel(device, level);
-        }
+        OutputHandler::setSoftDebugLevel(device, level);
      }
 
@@ -188,8 +156,5 @@
     const std::string& Core::getLanguage()
     {
-        if (!Core::isCreatingCoreSettings())
-            return Core::getInstance().language_;
-
-        return Language::getLanguage().defaultLanguage_;
+        return Core::getInstance().language_;
     }
 
