Crash when deleting bars with text line in staff with linked part
1. Open this file
.
2. Drag text line to a note in Electric Guitar 2 of bar 88.
3. Click on bar (selecting it).
4. Hold Shift and press Right (selecting until the end of score).
5. 'Edit'>'Delete Selected Measures'.
Result: Crash.
Note: See attached log.
Using MuseScore 2.0 Nightly Build c3624cf - Mac 10.7.5.
Attachment | Size |
---|---|
Crash when deleting bars with text line [Log].txt | 60.1 KB |
Comments
Crash is because after the deleting the measure, there are a few spanners form those deleted measures still in the map - not removed by checkSpanner() for some reason, apparently - and these crash the layout.
The crash is easy enough to fix: we need to check for m == 0 before dereferencing it here:
https://github.com/musescore/MuseScore/blob/master/libmscore/utils.cpp#…
The real question, though, is why these particular spanners (a textline and an ottava at least) are not deleted. I believe it is because of the linked parts. You can reproduce this in a file created from scratch very easily:
1) new score
2) generate parts
3) add some notes to measure 3
4) add a text line to one or more of those notes
5) select from measure before the text line to end
6) Ctrl+Delete
Result: crash
The crash is gone since https://github.com/musescore/MuseScore/commit/cfa99c6ca4cbdccefb7681ec6…, but the underlying cause is still there: the textline is not being rmoved from the spanner map, so doLayout() is still trying to lay it out. You can see the complaints on the console output:
tick2measure 6240 (max 0) not found
etc.
Wouldn't be surprised if this didn't lead to crashes or other bad things later.
Fixed in 2a67602f28
Automatically closed -- issue fixed for 2 weeks with no activity.