Fix crash when undoing note delete.
authorDavid Robillard <d@drobilla.net>
Mon, 12 Jan 2015 07:03:49 +0000 (02:03 -0500)
committerDavid Robillard <d@drobilla.net>
Mon, 12 Jan 2015 07:03:49 +0000 (02:03 -0500)
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_region_view.h

index 6e257cc0ee24c6686a9860906334c277ad5700ec..23c761178c1403ec521e513c385af74e3ba56ade 100644 (file)
@@ -1222,7 +1222,7 @@ MidiRegionView::redisplay_model()
 
                        } else {
 
-                               add_note (note, visible);
+                               cne = add_note (note, visible);
                        }
 
                        set<boost::shared_ptr<NoteType> >::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<NoteType> note, bool visible)
 {
        NoteBase* event = 0;
@@ -1852,6 +1852,7 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible)
        MidiStreamView* const view = mtv->midi_view();
 
        view->update_note_range (note->note());
+       return event;
 }
 
 void
index 6ffdf98c25a464a49ea095dab4da29fd4df3b9d9..1cfefa9aff7c5e11199e5f63009946a5bfa6c6f0 100644 (file)
@@ -119,7 +119,7 @@ public:
 
        GhostRegion* add_ghost (TimeAxisView&);
 
-       void add_note(const boost::shared_ptr<NoteType> note, bool visible);
+       NoteBase* add_note(const boost::shared_ptr<NoteType> note, bool visible);
        void resolve_note(uint8_t note_num, Evoral::Beats end_time);
 
        void cut_copy_clear (Editing::CutCopyOp);