Crash on changing a property of bracket in a part in Inspector

• Oct 11, 2018 - 09:29
Reported version
3.0
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Steps to reproduce:
1. Create a new score.
2. Add some bracket to a staff.
3. Generate parts (File→Parts→New All→OK).
So you obtain something like this score: test.mscz.
4. Switch to a part (Piano in the given file).
5. Select the bracket.
6. In Inspector change the bracket's column two times. Note that after the first change bracket will lose selection, this may be related to the issue.
Result: crash.

Tested on:
OS: Debian GNU/Linux 9 (stretch), Arch.: x86_64, MuseScore version (64-bit): 3.0.0, revision: b3feb3a


Comments

Status (old) active patch (code needs review)
Status active  

All brackets are deleted and recreated during Score::doLayoutRange(). Selected brackets are deselected before they are deleted. I had added some code a little while ago that attempted to remember which brackets had been selected, so that they could be selected again after being recreated. Unfortunately, this code is not working as intended, and it is what leads to the crash. Results are better all around if the code is removed. See https://github.com/musescore/MuseScore/pull/4033.