Crashing marking instruments invisible with hide empty staves enabled

• Dec 14, 2018 - 01:53
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Go to instruments, uncheck 'visible' flag on everything but the horns, hit okay, crash.

It doesn't crash if you only uncheck one instrument, or even the entire first page of instruments. You have to uncheck most of them.

I was trying to eyeball where I needed to put cues without messing with the currently crash-happy parts by making nothing but a single stave visible, if you're wondering why someone might do this.

Attachment Size
Dvorak_Symphony_No._8_Mvt1.mscz 220.44 KB

Comments

Title Crash on making staves invisible in instruments. Crashing marking instruments invisible with hide empty staves enabled
Priority P0 - Critical

I can confirm the crash, bd based on the console output, the cause pretty obvious: making all these staves invisible plus having hide empty staves enabled created some systems with no visible staves whatsoever. If you do it in the opposite order - first make staves invisible, then hide empty - it works fine, as we check for empty systems in hideEmptyStaves() and force some staff to stay visible. But apparently we don't do the same when making staves invisible, and somewhere this leads to trouble.

Might be a little tricky to deal with this directly, as making staves invisible will affect the system layout so we don't necessarily know which systems will be empty and which won't until it's too late. I guess we could temporarily disable hide empty staves and then re-enable it.

Anyhow, workaround is to disable hide empty staves before marking so many staves invisible.

Here's a simple score to reproduce the same condition, for further debugging purposes:

1) open attached score
2) edit / instruments
3) make soprano staff invisible

Result: second system is completely empty. No crash in this case, but we get the same error message. Probably it's other things about the layout that actually lead to the crash, but I'm betting if we tackle the underlying cause, the crash will go away.

Attachment Size
hide-crash.mscz 5.76 KB