fix bug in lifetime of MidiView::_ghost_note

As noted in 8b389ee829, 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
This commit is contained in:
Paul Davis 2025-04-23 14:34:19 -06:00
parent 86ef6a5e59
commit a41699737f

View file

@ -884,6 +884,8 @@ MidiView::clear_events ()
* NoteBase objects we just deleted. * NoteBase objects we just deleted.
*/ */
_note_group->clear (true); _note_group->clear (true);
/* the above line deleted the ghost note (if any). Make sure we know */
_ghost_note = nullptr;
_events.clear(); _events.clear();
_patch_changes.clear(); _patch_changes.clear();
_sys_exes.clear(); _sys_exes.clear();