I'm not sure but :
"erase" invalidates the iterator in the for loop.
Then it breaks so we exit the inner/for loop but we keep on the outer/do loop (since bLinkRemoved =true), then iLink iterator var is recreated and reinitialized with begin.
In brief, yep "erase" invalidates, but then iLink is valid again.
Now perhaps I miss something obvious.
I'm not sure but :
"erase" invalidates the iterator in the for loop.
Then it breaks so we exit the inner/for loop but we keep on the outer/do loop (since bLinkRemoved =true), then iLink iterator var is recreated and reinitialized with begin.
In brief, yep "erase" invalidates, but then iLink is valid again.
Now perhaps I miss something obvious.
234 do mpLinks- >begin( ); iLink!= mpLinks- >end(); ++iLink) >second. mpTargetWindow == pWindow) ntListener( iLink-> first); >erase( iLink);
235 {
236 bLinkRemoved = false;
237 LinkMap::iterator iLink;
238 for (iLink=
239 {
240 if (iLink-
241 {
242 RemoveUnusedEve
243 mpLinks-
244 bLinkRemoved = true;
245 break;
246 }
247 }
248 }
249 while (bLinkRemoved);