Skip to content

Commit

Permalink
Merge pull request #1458 from MarcSabatella/39341-setpos-recursion
Browse files Browse the repository at this point in the history
fix #39341: crash on tab entry
  • Loading branch information
lasconic committed Nov 17, 2014
2 parents 9509480 + 78afc76 commit b510547
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,9 @@ void Score::select(Element* e, SelectType type, int staffIdx)
Element* ee = e;
if (ee->type() == Element::Type::NOTE)
ee = ee->parent();
setPlayPos(static_cast<ChordRest*>(ee)->segment()->tick());
int tick = static_cast<ChordRest*>(ee)->segment()->tick();
if (playPos() != tick)
setPlayPos(tick);
}
if (MScore::debugMode)
qDebug("select element <%s> type %hhd(state %hhd) staff %d",
Expand Down Expand Up @@ -3439,6 +3441,8 @@ void Score::setPos(POS pos, int tick)
if (tick != _pos[int(pos)])
_pos[int(pos)] = tick;
// even though tick position might not have changed, layout might have
// so we should update cursor here
// however, we must be careful not to call setPos() again while handling posChanged, or recursion results
emit posChanged(pos, unsigned(tick));
}

Expand Down

0 comments on commit b510547

Please sign in to comment.