[Orxonox-commit 723] r3253 - in branches/core4: cmake src/core src/orxonox

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Jun 29 22:00:40 CEST 2009


Author: rgrieder
Date: 2009-06-29 22:00:40 +0200 (Mon, 29 Jun 2009)
New Revision: 3253

Modified:
   branches/core4/cmake/BuildConfigMSVC.cmake
   branches/core4/src/core/Core.cc
   branches/core4/src/orxonox/Main.cc
Log:
Minor fixes and changes.

Modified: branches/core4/cmake/BuildConfigMSVC.cmake
===================================================================
--- branches/core4/cmake/BuildConfigMSVC.cmake	2009-06-29 19:43:54 UTC (rev 3252)
+++ branches/core4/cmake/BuildConfigMSVC.cmake	2009-06-29 20:00:40 UTC (rev 3253)
@@ -34,7 +34,7 @@
 ######################## Options ########################
 
 # Currently VLD has a problem with MSVC9 although it actually is supported
-IF(MSVC8)
+IF(MSVC80)
   OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
 ENDIF()
 # Make sure the value is "on" or "off" for vld.ini

Modified: branches/core4/src/core/Core.cc
===================================================================
--- branches/core4/src/core/Core.cc	2009-06-29 19:43:54 UTC (rev 3252)
+++ branches/core4/src/core/Core.cc	2009-06-29 20:00:40 UTC (rev 3253)
@@ -228,7 +228,11 @@
 
     Core::Core(int argc, char** argv)
     {
-        assert(Core::singletonRef_s == 0);
+        if (singletonRef_s != 0)
+        {
+            COUT(0) << "Error: The Core singleton cannot be recreated! Shutting down." << std::endl;
+            abort();
+        }
         Core::singletonRef_s = this;
 
         // We need the variables very soon. But don't configure them yet!
@@ -263,13 +267,14 @@
         // the timer though).
         int limitToCPU = CommandLine::getValue("limitToCPU");
         if (limitToCPU > 0)
-            setThreadAffinity((unsigned int)limitToCPU);
+            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
 
         // Manage ini files and set the default settings file (usually orxonox.ini)
         this->configFileManager_ = new ConfigFileManager();
         this->configFileManager_->setFilename(ConfigFileType::Settings,
             CommandLine::getValue("settingsFile").getString());
 
+        // Required as well for the config values
         this->languageInstance_ = new Language();
 
         // Do this soon after the ConfigFileManager has been created to open up the
@@ -307,13 +312,12 @@
         CommandLine::destroyAllArguments();
         // Also delete external console command that don't belong to an Identifier
         CommandExecutor::destroyExternalCommands();
-
         // Clean up class hierarchy stuff (identifiers, XMLPort, configValues, consoleCommand)
         Identifier::destroyAllIdentifiers();
 
-        assert(Core::singletonRef_s);
-        Core::singletonRef_s = 0;
         delete this->signalHandler_;
+
+        // Don't assign singletonRef_s with NULL! Recreation is not supported
     }
 
     /**

Modified: branches/core4/src/orxonox/Main.cc
===================================================================
--- branches/core4/src/orxonox/Main.cc	2009-06-29 19:43:54 UTC (rev 3252)
+++ branches/core4/src/orxonox/Main.cc	2009-06-29 20:00:40 UTC (rev 3253)
@@ -87,6 +87,7 @@
     }
 
     game->run();
+    delete game;
 
     return 0;
 }




More information about the Orxonox-commit mailing list