}
}
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.begin();
- for ( ; anIter != VISUAL_OBJ_CONT.end(); ++anIter ) {
+ for ( ; anIter != VISUAL_OBJ_CONT.end(); ) {
int curId = anIter->first.first;
if ( curId == studyID ) {
// for unknown reason, object destructor is not called, so clear object manually
anIter->second->GetUnstructuredGrid()->SetCells(0,0,0);
anIter->second->GetUnstructuredGrid()->SetPoints(0);
- VISUAL_OBJ_CONT.erase( anIter-- ); // dercement occures before erase()
+ VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
+ }
+ else {
+ anIter++;
}
}
}