fix #289562: add missing blockSignals() calls on updating Mixer controls #5060
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://musescore.org/en/node/289562, or, at least, the symptoms of this issue.
Why this fix works
Not blocking signals from port and channel sliders on updating their values made
instrumentsChanged
flag in MasterScore be set totrue
every time these values were updated.MuseScore::endCmd()
triggers such an update every time if both Mixer exists and that flag is set to true. Fortunately a bit laterendCmd
sets this flag to false again but this doesn't manage to happen if the score has just been opened. The workaround by pressing Escape button before adding an instrument mentioned here works exactly because it makesendCmd()
be called and, thus, resets the mentioned flag tofalse
.Why the issue appeared only in 3.1-RC
The issue became much more visible after merging #5011 which caused Mixer object be created regardless of being actually displayed. In fact, the issue exists at least from 3.0.4 version (probably 3.0.3 but I tested it only on 3.0.4). In order to reproduce the issue on the versions before 3.1-RC one should open a Mixer window before executing steps 4-5 from this comment.
Although this fix works the more fundamental problem is probably having a somewhat invalid instruments and channels state at the moment when
MuseScore::endCmd()
gets executed on updating a score here. Without that the signals blocking issue fixed here would cause only a small negative performance effect rather than a crash. This more fundamental issue should probably be addressed later but this patch should also be good to apply regardless of that.