Dropping a bracket onto a bracket causes a crash
When I try to change a system bracket from one type to another, MuseScore crashes.
To reproduce:
1. Drag a bracket from the palette to any system.
2. Drag another bracket from the palette and drop it onto the bracket created in step 1.
At this point, MuseScore will crash. This is because Bracket::drop() returns an element that it has just deleted. The calling function will then try to select the element that has just been deleted, and that is when the crash occurs. Bracket::drop() should instead return either nullptr
or this
.
Comments
The purpose of the return value of Element::drop() is to select the appropriate element after the drop takes place. In the case of Bracket::drop(), the correct return value is
this
. In MuseScore 3, brackets are deleted and recreated during layout, so even if Bracket::drop() returnsthis
, the bracket will not be selected after layout occurs. Score::doLayoutRange() is smart enough to remove brackets from the selection list before it erases the systems. It might be nice if it added back to the selection list any brackets it deselected after the brackets are recreated.See fix #273488: Dropping a bracket onto a bracket causes a crash #3735.
Another problem is that the bracket type is not changed, even if the crash is avoided. fix #230311: Inability to delete one or more brackets #3732, which fixes a different issue, solves this second problem.
Fixed in branch master, commit bb400edf5e
fix #273488: Dropping a bracket onto a bracket causes a crash
Fixed in branch master, commit dff4fcc65f
Merge pull request #3735 from mattmcclinch/273488-bracket-drop
fix #273488: Dropping a bracket onto a bracket causes a crash
Automatically closed -- issue fixed for 2 weeks with no activity.