Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 6, 2015, 10:37:40 AM (9 years ago)
Author:
landauf
Message:

identifier removes itself from all related identifiers when being destroyed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/class/Identifier.cc

    r10512 r10526  
    8181        for (std::list<const InheritsFrom*>::const_iterator it = this->manualDirectParents_.begin(); it != this->manualDirectParents_.end(); ++it)
    8282            delete (*it);
     83
     84        // erase this Identifier from all related identifiers
     85        for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
     86            const_cast<Identifier*>(*it)->children_.erase(this);
     87        for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
     88            const_cast<Identifier*>(*it)->directChildren_.erase(this);
     89        for (std::set<const Identifier*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)
     90            const_cast<Identifier*>(*it)->parents_.remove(this);
     91        for (std::set<const Identifier*>::const_iterator it = this->directChildren_.begin(); it != this->directChildren_.end(); ++it)
     92            const_cast<Identifier*>(*it)->directParents_.remove(this);
    8393
    8494        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
Note: See TracChangeset for help on using the changeset viewer.