Changeset 10536 for code/branches/core7/src
- Timestamp:
- Jun 7, 2015, 12:12:20 AM (9 years ago)
- Location:
- code/branches/core7/src/libraries/core/module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/module/ModuleInstance.cc
r10535 r10536 65 65 void ModuleInstance::unloadAllStaticallyInitializedInstances(StaticInitialization::Type type) 66 66 { 67 // unload in reversed order 67 68 const std::set<StaticallyInitializedInstance*>& instances = this->staticallyInitializedInstancesByType_[type]; 68 for (std::set<StaticallyInitializedInstance*>:: iterator it = instances.begin(); it != instances.end(); ++it)69 for (std::set<StaticallyInitializedInstance*>::reverse_iterator it = instances.rbegin(); it != instances.rend(); ++it) 69 70 (*it)->unload(); 70 71 } -
code/branches/core7/src/libraries/core/module/StaticInitializationManager.cc
r10532 r10536 51 51 void StaticInitializationManager::loadModule(ModuleInstance* module) 52 52 { 53 // attention: loading a module may add new handlers to the list 53 54 for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it) 54 55 (*it)->loadModule(module); … … 57 58 void StaticInitializationManager::unloadModule(ModuleInstance* module) 58 59 { 59 for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it) 60 (*it)->unloadModule(module); 60 // unload in reversed order 61 // attention: unloading a module may remove handlers from the list 62 for (std::list<StaticInitializationHandler*>::reverse_iterator it = this->handlers_.rbegin(); it != this->handlers_.rend(); ) 63 (*(it++))->unloadModule(module); 61 64 } 62 65 }
Note: See TracChangeset
for help on using the changeset viewer.