Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 6:23:52 PM (16 years ago)
Author:
landauf
Message:

fixed an interesting bug in ObjectList/MetaObjectList/Iterator: it's now possible to delete multiple objects in one function-call while iterating through the objects. (and it would have crashed with std::list as well, so no stupid comments please :D)

added a feature in Timer.cc, allowing timers to tick faster than orxonox. this is from core2-branch but got lost while merging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/MetaObjectList.h

    r1056 r1063  
    8989    MetaObjectListElement<T>::~MetaObjectListElement()
    9090    {
     91        COUT(5) << "*** MetaObjectList: Removing Object from " << ClassManager<T>::getIdentifier()->getName() << "-list." << std::endl;
     92        this->list_->notifyIterators(this->element_);
     93
    9194        if (this->element_->next_)
    9295            this->element_->next_->prev_ = this->element_->prev_;
     
    99102            this->list_->first_ = this->element_->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
    100103
    101 
    102         COUT(5) << "*** MetaObjectList: Removing Object from " << ClassManager<T>::getIdentifier()->getName() << "-list." << std::endl;
    103104        delete this->element_;
    104105    }
     
    106107
    107108    // ###############################
    108     // ###       ObjectList        ###
     109    // ###     MetaObjectList      ###
    109110    // ###############################
    110111    //!  The MetaObjectList contains ObjectListElements and their ObjectLists.
Note: See TracChangeset for help on using the changeset viewer.