Skip to content

Commit

Permalink
fix #31151: crash on add of frame from linked part
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Aug 29, 2014
1 parent abc70ae commit 98f6050
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libmscore/edit.cpp
Expand Up @@ -2243,7 +2243,9 @@ MeasureBase* Score::insertMeasure(Element::Type type, MeasureBase* measure, bool
for (Score* score : scoreList())
ml.append(pair<Score*,MeasureBase*>(score, searchMeasureBase(score, measure)));

MeasureBase* omb = nullptr;
MeasureBase* omb = nullptr; // measure base in "this" score
MeasureBase* rmb = nullptr; // measure base in root score (for linking)

for (pair<Score*, MeasureBase*> p : ml) {
Score* score = p.first;
MeasureBase* im = p.second;
Expand Down Expand Up @@ -2350,8 +2352,11 @@ MeasureBase* Score::insertMeasure(Element::Type type, MeasureBase* measure, bool
score->fixTicks();
}
else {
if (mb != omb)
mb->linkTo(omb);
// a frame, not a measure
if (score == rootScore())
rmb = mb;
else if (rmb && mb != rmb)
mb->linkTo(rmb);
undo(new InsertMeasure(mb, im));
}
}
Expand Down

0 comments on commit 98f6050

Please sign in to comment.