File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,9 @@ void Score::update(bool resetCmdState)
277
277
CmdState& cs = ms->cmdState ();
278
278
ms->deletePostponed ();
279
279
if (cs.layoutRange ()) {
280
- cs.lock ();
281
280
for (Score* s : ms->scoreList ())
282
281
s->doLayoutRange (cs.startTick (), cs.endTick ());
283
282
updateAll = true ;
284
- cs.unlock ();
285
283
}
286
284
}
287
285
Original file line number Diff line number Diff line change @@ -4334,12 +4334,25 @@ void Score::doLayout()
4334
4334
doLayoutRange (Fraction (0 ,1 ), Fraction (-1 ,1 ));
4335
4335
}
4336
4336
4337
+ // ---------------------------------------------------------
4338
+ // CmdStateLocker
4339
+ // ---------------------------------------------------------
4340
+
4341
+ class CmdStateLocker {
4342
+ Score* score;
4343
+ public:
4344
+ CmdStateLocker (Score* s) : score(s) { score->cmdState ().lock (); }
4345
+ ~CmdStateLocker () { score->cmdState ().unlock (); }
4346
+ };
4347
+
4337
4348
// ---------------------------------------------------------
4338
4349
// doLayoutRange
4339
4350
// ---------------------------------------------------------
4340
4351
4341
4352
void Score::doLayoutRange (const Fraction& st, const Fraction& et)
4342
4353
{
4354
+ CmdStateLocker cmdStateLocker (this );
4355
+
4343
4356
Fraction stick (st);
4344
4357
Fraction etick (et);
4345
4358
Q_ASSERT (!(stick == Fraction (-1 ,1 ) && etick == Fraction (-1 ,1 )));
You can’t perform that action at this time.
0 commit comments