diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc index da6fcece21..7f2a32af5e 100644 --- a/gtk2_ardour/hit.cc +++ b/gtk2_ardour/hit.cc @@ -40,7 +40,9 @@ Hit::Hit (MidiView& region, Item* parent, double size, const std::shared_ptrclear (true); + /* The above did not actually delete the the NoteBase* elements, so do that now */ + for (auto & [model_note,gui_note] : _events) { + delete gui_note; + } _events.clear(); _patch_changes.clear(); _sys_exes.clear(); diff --git a/gtk2_ardour/note.cc b/gtk2_ardour/note.cc index 7ccba8b808..2fcf37f763 100644 --- a/gtk2_ardour/note.cc +++ b/gtk2_ardour/note.cc @@ -39,7 +39,9 @@ Note::Note (MidiView& region, ArdourCanvas::Item* parent, const std::shared_ptr< Note::~Note () { - delete _visual_note; + /* do not delete the canvas item here, because that will be handled by + * the parent + */ } void diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index 16594ee857..deb9c2527e 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -88,8 +88,7 @@ NoteBase::NoteBase(MidiView& v, bool with_events, const std::shared_ptr