From a41699737f754569ff809d88a6b2d83ec1d6daf1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 23 Apr 2025 14:34:19 -0600 Subject: [PATCH] fix bug in lifetime of MidiView::_ghost_note As noted in 8b389ee8296f, we now clear the _note_group container before any other Note items might be deleted. But since this may delete the _ghost_note, we have to be sure to reset that to a null ptr to avoid a double-free later during ~MidiView --- gtk2_ardour/midi_view.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index d8469e4af5..408f23b118 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -884,6 +884,8 @@ MidiView::clear_events () * NoteBase objects we just deleted. */ _note_group->clear (true); + /* the above line deleted the ghost note (if any). Make sure we know */ + _ghost_note = nullptr; _events.clear(); _patch_changes.clear(); _sys_exes.clear();