From 18c4040b77c2699f78f012fd9bb1c9feb88b791a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 13 May 2025 12:10:37 -0600 Subject: [PATCH] fix crash/memory mgmt during MIDI clip recording the active notes that are extended by transport rolling are owned by MidiView::_events, not MidiView::_active_notes, so do not delete them when cleaning up _active_notes. --- gtk2_ardour/midi_view.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index 460252384b..77bc170988 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -1647,9 +1647,10 @@ void MidiView::end_write() { if (_active_notes) { - for (unsigned i = 0; i < 128; ++i) { - delete _active_notes[i]; - } + /* do not delete individual notes referenced here, because they are + owned by _events. Just delete the container used for active + notes only. + */ delete [] _active_notes; }