diff --git a/src/libCom/cxxTemplates/resourceLib.h b/src/libCom/cxxTemplates/resourceLib.h index 6b7f0bc83..42c81eaeb 100644 --- a/src/libCom/cxxTemplates/resourceLib.h +++ b/src/libCom/cxxTemplates/resourceLib.h @@ -392,8 +392,10 @@ void resTable::traverse ( void (T::*pCB)() ) while ( pList < &this->pTable[this->hashIdMask+1] ) { tsSLIter pItem = pList->firstIter (); while ( pItem.valid () ) { + tsSLIter pNext = pItem; + pNext++; ( pItem.pointer ()->*pCB ) (); - pItem++; + pItem = pNext; } pList++; } @@ -411,8 +413,10 @@ void resTable::traverseConst ( void (T::*pCB)() const ) const while ( pList < &this->pTable[this->hashIdMask+1] ) { tsSLIterConst pItem = pList->firstIter (); while ( pItem.valid () ) { + tsSLIter pNext = pItem; + pNext++; ( pItem.pointer ()->*pCB ) (); - pItem++; + pItem = pNext; } pList++; }