Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2009, 10:00:40 PM (16 years ago)
Author:
rgrieder
Message:

Minor fixes and changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/core/Core.cc

    r3248 r3253  
    229229    Core::Core(int argc, char** argv)
    230230    {
    231         assert(Core::singletonRef_s == 0);
     231        if (singletonRef_s != 0)
     232        {
     233            COUT(0) << "Error: The Core singleton cannot be recreated! Shutting down." << std::endl;
     234            abort();
     235        }
    232236        Core::singletonRef_s = this;
    233237
     
    264268        int limitToCPU = CommandLine::getValue("limitToCPU");
    265269        if (limitToCPU > 0)
    266             setThreadAffinity((unsigned int)limitToCPU);
     270            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
    267271
    268272        // Manage ini files and set the default settings file (usually orxonox.ini)
     
    271275            CommandLine::getValue("settingsFile").getString());
    272276
     277        // Required as well for the config values
    273278        this->languageInstance_ = new Language();
    274279
     
    308313        // Also delete external console command that don't belong to an Identifier
    309314        CommandExecutor::destroyExternalCommands();
    310 
    311315        // Clean up class hierarchy stuff (identifiers, XMLPort, configValues, consoleCommand)
    312316        Identifier::destroyAllIdentifiers();
    313317
    314         assert(Core::singletonRef_s);
    315         Core::singletonRef_s = 0;
    316318        delete this->signalHandler_;
     319
     320        // Don't assign singletonRef_s with NULL! Recreation is not supported
    317321    }
    318322
Note: See TracChangeset for help on using the changeset viewer.