Originally submitted by @SockHungryClutz
## How to Reproduce:
* Go into editor for any level
* Select a single note
* Right click
* Select
Delete
* Try to place a new note
### Another side effect of this bug:
* Open editor for any level
* Drag select a group of notes
* Right click a note
* Select
Delete
*
Expected Behavior
* All notes that were selected are deleted
*
Observed Behavior
* Only the note that was right clicked is deleted
* All other notes are left selected
## Root Cause
*
Summary
* The crash is occurring because the
create_note
function believes that there are selected notes in the editor but at least one of those notes has already been freed because of the context menu delete. This is because the context menu delete function for editor notes does not check if this note was selected or other notes are selected.
*
Possible fixes
*
EditorNote
should check if any notes are selected when running a context menu action and call the
run_action
function for each of the other notes. If the delete function was selected, the
selected_notes
array should also be cleared.
* Any time
selected_notes
is being iterated over, there should also be a check to name sure the note is not
null
.