Fixed invalidated iterator bug pick up by Coverity.
This commit is contained in:
parent
2f4064d757
commit
37f6e2b39e
@ -460,7 +460,7 @@ struct LineConstructor
|
||||
|
||||
for(SegmentSet::iterator itr = _segments.begin();
|
||||
itr != _segments.end();
|
||||
++itr)
|
||||
) // itr increment is done manually at end of loop
|
||||
{
|
||||
SegmentSet::iterator nextItr = itr;
|
||||
++nextItr;
|
||||
@ -1060,6 +1060,9 @@ struct LineConstructor
|
||||
|
||||
classification = ((itr != _segments.end()) && (nextItr != _segments.end())) ? itr->compare(*nextItr) : Segment::UNCLASSIFIED;
|
||||
}
|
||||
|
||||
// increment iterator it it's not already at end of container.
|
||||
if (itr!=_segments.end()) ++itr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user