13
0

avoid possible iterator corruption in MIDI region selection handling

This commit is contained in:
Paul Davis 2021-03-18 12:49:51 -06:00
parent a2b1482cad
commit 985eb93674

View File

@ -1683,12 +1683,15 @@ Editor::select_all_internal_edit (Selection::Operation)
{
bool selected = false;
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ) {
RegionSelection::iterator tmp = i;
++tmp;
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
if (mrv) {
mrv->select_all_notes ();
selected = true;
}
i = tmp;
}
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(entered_regionview);