- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/core/object/Context.cc
r10624 r11054 40 40 RegisterClass(Context); 41 41 42 Context* Context::rootContext_s = 0;42 Context* Context::rootContext_s = nullptr; 43 43 44 44 Context* getContextForInitializationOfOtherContexts() … … 46 46 static size_t count = 0; 47 47 // the first time this is called, ++count returns 1 and the context is created 48 // the second time this is called, ++count returns 2 and NULLis returned because we're in the constructor of the context itself48 // the second time this is called, ++count returns 2 and nullptr is returned because we're in the constructor of the context itself 49 49 // for each future call the context (now completely created) is returned 50 50 if (++count == 2) 51 return NULL;51 return nullptr; 52 52 else 53 53 { 54 static Context context( NULL);54 static Context context(nullptr); 55 55 return &context; 56 56 } … … 70 70 // unregister context from object lists before object lists are destroyed 71 71 this->unregisterObject(); 72 for ( size_t i = 0; i < this->objectLists_.size(); ++i)73 delete this->objectLists_[i];72 for (ObjectListBase* objectList : this->objectLists_) 73 delete objectList; 74 74 } 75 75 … … 82 82 { 83 83 delete Context::rootContext_s; 84 Context::rootContext_s = NULL;84 Context::rootContext_s = nullptr; 85 85 } 86 86 87 87 /*static*/ Context* Context::getRootContext() 88 88 { 89 OrxVerify(Context::rootContext_s != NULL, "Root Context is undefined");89 OrxVerify(Context::rootContext_s != nullptr, "Root Context is undefined"); 90 90 return Context::rootContext_s; 91 91 } … … 105 105 ObjectListBase* objectList = this->getObjectList(identifier); 106 106 delete objectList; 107 this->objectLists_[identifier->getClassID()] = NULL;107 this->objectLists_[identifier->getClassID()] = nullptr; 108 108 } 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.