Changeset 9649 for code/branches/core6/src
- Timestamp:
- Aug 14, 2013, 6:42:28 PM (11 years ago)
- Location:
- code/branches/core6/src/libraries/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/Core.cc
r9640 r9649 248 248 safeObjectDelete(&configFileManager_); 249 249 ConsoleCommand::destroyAll(); 250 Context::setRootContext(NULL); 250 251 IdentifierManager::getInstance().destroyAllIdentifiers(); 251 252 safeObjectDelete(&signalHandler_); -
code/branches/core6/src/libraries/core/object/Context.cc
r9629 r9649 37 37 namespace orxonox 38 38 { 39 Context* Context::rootContext_s = 0; 40 39 41 Context::Context(Context* context) : Listable(this), parentContext_(context) 40 42 { … … 54 56 } 55 57 58 /*static*/ void Context::setRootContext(Context* context) 59 { 60 if (Context::rootContext_s) 61 delete Context::rootContext_s; 62 Context::rootContext_s = context; 63 } 64 56 65 /*static*/ Context* Context::getRootContext() 57 66 { 58 static Context rootContext(NULL); 59 return &rootContext; 67 if (!Context::rootContext_s) 68 Context::rootContext_s = new Context(NULL); 69 return Context::rootContext_s; 60 70 } 61 71 -
code/branches/core6/src/libraries/core/object/Context.h
r9629 r9649 46 46 { 47 47 public: 48 static void setRootContext(Context* context); 48 49 static Context* getRootContext(); 49 50 … … 72 73 Context* parentContext_; 73 74 std::vector<ObjectListBase*> objectLists_; 75 76 static Context* rootContext_s; 74 77 }; 75 78 }
Note: See TracChangeset
for help on using the changeset viewer.