Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a selected custom instrument can cause a crash #493

Open
CreeperPookie opened this issue Dec 16, 2024 · 2 comments
Open

Deleting a selected custom instrument can cause a crash #493

CreeperPookie opened this issue Dec 16, 2024 · 2 comments
Labels
C: Bug Something isn't working
Milestone

Comments

@CreeperPookie
Copy link

Describe the bug
While experimenting with custom instruments for a song I'm working on, I noticed a weird bug when deleting them. It completely bypasses the confirm dialog when deleting a custom instrument, which is very odd even by itself; it also makes all the instances of that instrument invisible, and performing any action on the selection (besides moving it) causes NBS to crash.

To Reproduce
Steps to reproduce the behavior:

  1. Make a new song (this definitely can be done on an existing song, but with a bug, this isn't the best idea!)
  2. Go to the instrument settings and make a new custom instrument
  3. Click OK to dismiss the menu, and make a new note in the new custom instrument
  4. Select the note you just created, and without deselecting the note go to the instrument settings and delete the custom instrument
  5. Observe how the warning is bypassed and how any action (including deselecting it and playing it) will crash NBS

Expected behavior
I would expect NBS to clear the selection of the deleted notes and to warn about deleting notes contained in the current selection. Most importantly, to not crash too :D

Additional context
I highly suspect the reason this is happening is that the check for deleting a custom instrument isn't taking into account notes within the user's selection; this also explains why it isn't displaying the warning about deleting notes since there aren't any other notes in that instrument outside the selection.
Of course, since the crash doesn't occur until it tries to "save" the deleted notes into memory (save as in commit the selection changes into the memory song copy) if you delete the selection with the right-click context menu or the delete key NBS won't crash because the deleted notes actually get removed. However, I wouldn't consider this a complete workaround since the selection could contain not deleted notes, which would be removed as well.

@Bentroen
Copy link
Member

Bentroen commented Dec 16, 2024

Related to #181, which was fixed by showing a confirmation dialog and deleting the notes with that instrument.
But notes in the selection are not deleted, apparently :)
Thanks for reporting!

@Bentroen Bentroen modified the milestones: v3.11, v3.x Dec 16, 2024
@Bentroen Bentroen added the C: Bug Something isn't working label Dec 16, 2024
@CreeperPookie
Copy link
Author

Related to #181, which was fixed by showing a confirmation dialog and deleting the notes with that instrument. But notes in the selection are not deleted, apparently :)

ah, I missed that issue, I definitely would have referenced that!

Thanks for reporting!
no problem, happy to help :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants