From 85f5100665bdf0a6aa34a19955f6c406329542ab Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 20 Feb 2001 18:47:20 +0000 Subject: [PATCH] fixed loop iteration bug in traversal functions --- src/libCom/cxxTemplates/resourceLib.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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++; }