Merge pull request #336 from mgavioli/Fix_21000_Crash_on_deleting_segm_annotation

Fix #21000 - Deleting the last annotation of a segment causes crash
This commit is contained in:
Maurizio M. Gavioli 2013-05-07 04:09:07 -07:00
commit 9a4c9adc34

View file

@ -985,8 +985,10 @@ bool Segment::findAnnotationOrElement(ElementType type, int minTrack, int maxTra
void Segment::removeAnnotation(Element* e)
{
for (auto i = _annotations.begin(); i != _annotations.end(); ++i) {
if (*i == e)
if (*i == e) {
_annotations.erase(i);
break;
}
}
}