Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on drop time sig or key sig #26427

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

mike-spa
Copy link
Contributor

Resolves: #26423
Resolves: #26414
Resolves: #25395

@cbjeukendrup EditData::dropElement can't be used after the drop, because it is often deleted during the drop itself (see for instance Measure::drop on the case ElementType::KEYSIG). In turn, it's the drop method which returns (if possible) the element to be selected after the drop, and the selection is already done in NotationInteraction::doDropStandard and NotationInteraction::doDropTextBaseAndSymbols so it shouldn't be necessary to do it here too.

The last issue is not a real issue, just an assert failure on an edge case that's only relevant with debug builds, but I've fixed it anyway.

Fix assert failure on edge case no instrument
@cbjeukendrup
Copy link
Contributor

Can't check right now, but I'm afraid this reintroduces issue 1 from #24147 (comment).

@mike-spa
Copy link
Contributor Author

Can't check right now, but I'm afraid this reintroduces issue 1 from #24147 (comment).

Ok thanks, I'll try to look into that if I have a moment.

@mike-spa
Copy link
Contributor Author

Can't check right now, but I'm afraid this reintroduces issue 1 from #24147 (comment).

Update: it did in fact reintroduce that issue, so I've made an alternative solution in the last commit. @avvvvve best if you double check that one too :)

Copy link
Contributor

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mike-spa mike-spa merged commit 020d4c7 into musescore:master Feb 11, 2025
11 checks passed
@avvvvve
Copy link

avvvvve commented Feb 11, 2025

late, but looks good, thanks!

@mike-spa mike-spa deleted the fixCrashOnDropTimeSigOrKeySig branch February 17, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants