Changeset 9649 for code/branches/core6/src/libraries/core/object/Context.cc
- Timestamp:
- Aug 14, 2013, 6:42:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.