From 4438263d4d0168581329952a995d0c5887d7f7d2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 12 Jan 2015 02:03:49 -0500 Subject: Fix crash when undoing note delete. --- gtk2_ardour/midi_region_view.cc | 5 +++-- gtk2_ardour/midi_region_view.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 6e257cc0ee..23c761178c 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1222,7 +1222,7 @@ MidiRegionView::redisplay_model() } else { - add_note (note, visible); + cne = add_note (note, visible); } set >::iterator it; @@ -1794,7 +1794,7 @@ MidiRegionView::update_hit (Hit* ev, bool update_ghost_regions) * notes, and resolve_note should be called when the corresponding note off * event arrives, to properly display the note. */ -void +NoteBase* MidiRegionView::add_note(const boost::shared_ptr note, bool visible) { NoteBase* event = 0; @@ -1852,6 +1852,7 @@ MidiRegionView::add_note(const boost::shared_ptr note, bool visible) MidiStreamView* const view = mtv->midi_view(); view->update_note_range (note->note()); + return event; } void diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index 6ffdf98c25..1cfefa9aff 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -119,7 +119,7 @@ public: GhostRegion* add_ghost (TimeAxisView&); - void add_note(const boost::shared_ptr note, bool visible); + NoteBase* add_note(const boost::shared_ptr note, bool visible); void resolve_note(uint8_t note_num, Evoral::Beats end_time); void cut_copy_clear (Editing::CutCopyOp); -- cgit v1.2.3