Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3669 in orxonox.OLD for orxonox/trunk/src/lib/util


Ignore:
Timestamp:
Mar 30, 2005, 12:06:36 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: now garbage collection is working correctlymake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/util/list.h

    r3668 r3669  
    6565 private:
    6666  listElement<T>* currentEl;
    67   listElement<T>* firstEl;
    68   int counter;
     67  listElement<T>* tmpEl;
    6968};
    7069
     
    7473{
    7574  this->currentEl = startElement;
    76   this->firstEl = startElement;
    77   if( this->firstEl != NULL)
    78     this->counter = -1; 
    79   else
    80     this->counter = 0;
     75  this->tmpEl = NULL;
    8176}
    8277
     
    9287inline T* tIterator<T>::nextElement ()
    9388{
    94   /*
    95   this->counter++;
    96   if( this->counter == 0)
    97     return this->firstEl->curr;
    98   */
    99 
    10089  if( this->currentEl == NULL)
    10190    return NULL;
    10291
    103   listElement<T>* tmp = this->currentEl;
     92  this->tmpEl = this->currentEl;
    10493  this->currentEl = this->currentEl->next;
    105   return tmp->curr;
     94  return this->tmpEl->curr;
    10695}
    10796
Note: See TracChangeset for help on using the changeset viewer.