Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2015, 12:12:20 AM (9 years ago)
Author:
landauf
Message:

unload in reversed order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/module/StaticInitializationManager.cc

    r10532 r10536  
    5151    void StaticInitializationManager::loadModule(ModuleInstance* module)
    5252    {
     53        // attention: loading a module may add new handlers to the list
    5354        for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it)
    5455            (*it)->loadModule(module);
     
    5758    void StaticInitializationManager::unloadModule(ModuleInstance* module)
    5859    {
    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);
    6164    }
    6265}
Note: See TracChangeset for help on using the changeset viewer.