Changeset 10543 for code/branches/core7
- Timestamp:
- Jun 7, 2015, 2:50:04 PM (9 years ago)
- Location:
- code/branches/core7/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Core.cc
r10542 r10543 123 123 this->dynLibManager_ = new DynLibManager(); 124 124 125 // TODO: initialize Root-Context125 // create handler for static initialization 126 126 new StaticInitializationManager(); // create singleton 127 127 this->staticInitHandler_ = new CoreStaticInitializationHandler(); 128 128 StaticInitializationManager::getInstance().addHandler(this->staticInitHandler_); 129 129 130 // load root module (all libraries which are linked to the executable, including core, network, and orxonox) 130 131 this->rootModule_ = ModuleInstance::getCurrentModuleInstance(); 131 132 StaticInitializationManager::getInstance().loadModule(this->rootModule_); … … 170 171 orxout(internal_info) << "Loading language:" << endl; 171 172 this->languageInstance_ = new Language(); 173 174 // initialize root context 175 Context::setRootContext(new Context(NULL)); 172 176 173 177 // Do this soon after the ConfigFileManager has been created to open up the … … 251 255 if (this->staticInitHandler_) 252 256 StaticInitializationManager::getInstance().removeHandler(this->staticInitHandler_); 257 delete Context::getRootContext(); 253 258 Context::setRootContext(NULL); 254 259 safeObjectDelete(&rootModule_); -
code/branches/core7/src/libraries/core/object/Context.cc
r10539 r10543 76 76 /*static*/ void Context::setRootContext(Context* context) 77 77 { 78 if (Context::rootContext_s)79 delete Context::rootContext_s;80 78 Context::rootContext_s = context; 81 79 } … … 83 81 /*static*/ Context* Context::getRootContext() 84 82 { 85 if (!Context::rootContext_s) 86 Context::rootContext_s = new Context(NULL); 83 OrxVerify(Context::rootContext_s != NULL, "Root Context is undefined"); 87 84 return Context::rootContext_s; 88 85 }
Note: See TracChangeset
for help on using the changeset viewer.