NoteBase-derived note objects must delete their children, because often they are deleted long before the parent (group) is. However, in MidiView::clear_events() we used to call _note_group->clear (true) first, which would delete the canvas items owned by these objects, without them knowing about it. This made it dangerous for them to delete those same items in their destructors. This reverses the ordering so that NoteBase objects are deleted first (along with their canvas items) and after that we clear _note_group which will address any danging canvas items created there that are not owned by a NoteBase-derived object
2.7 KiB
2.7 KiB