Skip to content

Commit

Permalink
Don't reuse _optimization_iterator - fixes crash on multiple note del…
Browse files Browse the repository at this point in the history
…ete undo.
  • Loading branch information
nmains committed Jan 13, 2015
1 parent 7a3662b commit 5ef868e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions gtk2_ardour/midi_region_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1117,17 +1117,11 @@ MidiRegionView::find_canvas_note (boost::shared_ptr<NoteType> note)
NoteBase*
MidiRegionView::find_canvas_note (NoteType note)
{
if (_optimization_iterator != _events.end()) {
++_optimization_iterator;
}

if (_optimization_iterator != _events.end() && (*(*_optimization_iterator)->note()) == note) {
return *_optimization_iterator;
}
Events::iterator it;

for (_optimization_iterator = _events.begin(); _optimization_iterator != _events.end(); ++_optimization_iterator) {
if (*((*_optimization_iterator)->note()) == note) {
return *_optimization_iterator;
for (it = _events.begin(); it != _events.end(); ++it) {
if (*((*it)->note()) == note) {
return *it;
}
}

Expand Down

0 comments on commit 5ef868e

Please sign in to comment.