Skip to content

Commit

Permalink
Merge pull request #4945 from songchaow/fix-287515-crash
Browse files Browse the repository at this point in the history
fix #284012 and #287515: Crash by editing/selecting entire score when another hidden staff contains beamed notes
  • Loading branch information
dmitrio95 authored Apr 22, 2019
2 parents 222dfa4 + 88bc651 commit 6c58cef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3663,8 +3663,13 @@ void Score::layoutSystemElements(System* system, LayoutContext& lc)

for (Segment* s : sl) {
for (Element* e : s->elist()) {
if (!e || !e->isChordRest() || !score()->staff(e->staffIdx())->show())
if (!e || !e->isChordRest() || !score()->staff(e->staffIdx())->show()) {
// the beam and its system may still be referenced when selecting all,
// even if the staff is invisible. The old system is invalid and does cause problems in #284012
if (e && e->isChordRest() && !score()->staff(e->staffIdx())->show() && toChordRest(e)->beam())
toChordRest(e)->beam()->setParent(nullptr);
continue;
}
ChordRest* cr = toChordRest(e);

// layout beam
Expand Down

0 comments on commit 6c58cef

Please sign in to comment.