Crash when adjusting a system bracket loaded from a template
To reproduce:
1. Create a new score using the Grand Staff template.
2. Select any system bracket/brace.
3. Use the inspector to adjust the column property of the selected bracket.
At this point, MuseScore will crash.
While I was working on the fix for #230311: Inability to delete one or more brackets, I realized that it was not safe to push BracketItem objects to the undo stack, and that they should instead be obtained from their staff and column properties. It is in trying to obtain the bracket item in the manner that is where the crash occurs.
It turns out that this bracket item’s staff property is not set to the Staff to which it belongs. The reason for this can be traced back to Staff::init(Staff*)
, where the bracket item is copied from the original staff, but its staff property is not set to the new Staff.
Comments
See fix #273917: Crash when adjusting a system bracket loaded from a template #3778.
Fixed in branch master, commit 145d35d230
fix #273917: Crash when adjusting a system bracket loaded from a template
Fixed in branch master, commit 697497b10b
Merge pull request #3778 from mattmcclinch/273917-bracket-crash
fix #273917: Crash when adjusting a system bracket loaded from a template
Automatically closed -- issue fixed for 2 weeks with no activity.