Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #63231: crash shortening a spanner #2094

Merged

Conversation

MarcSabatella
Copy link
Contributor

See also https://musescore.org/en/node/66396. In both cases, there was a crash on an operation that normally invovles spanners being shortened in checkSpanner(), although the crash was OS-dependent. @AntonioBL tracked it down in that case to the undoChangeProperty() call, and I am 99% sure this will also explain https://musescore.org/en/node/63231.

My fix is to simply the shortening of the spanner outside the loop just as is done when removing them. I also restructured things a little to avoid calling computeEndElement() for spanners we are about to delete or shorten.

I also changed the call to undoChangeProperty() to undo(new ChangeProperty()). The main difference is that the former goes through links to make the same adjustment, but I don't think that is necessary or advisable here. For linked parts, we are going to call checkSpanner() on the linked parts separately. And for linked staves within the same score, we are going to add both spanners to this list separately, so I don't see any reason not to just shorten them separately too.

In the case of https://musescore.org/en/node/66396, it is still not known how this situation arose in the first place. This was not a case of shortening a score; it happened on read. Apparently there is a stray haipin in some of the mmrests in the parts for that score, and that probably suggests another bug somewhere that led to those being created. But we don't (yet) have steps to reproduce. My fix here simply allows those hairpins - which are not linked - to extend to the end of the relevant parts.

lasconic added a commit that referenced this pull request Jun 26, 2015
…anner

fix #63231: crash shortening a spanner
@lasconic lasconic merged commit e44f841 into musescore:master Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants