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

Prevent crash on system with no measures #26473

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Feb 13, 2025

Resolves: #24705
Resolves: #24648

Crash on layout change which results in a system with a single measure being removed. This crash does not happen when deleting the measure.

Screen.Recording.2025-02-13.at.11.37.15.mov

@oktophonie oktophonie requested a review from mike-spa February 13, 2025 11:39
@oktophonie oktophonie added the crash Issues involving a crash of MuseScore label Feb 13, 2025
@@ -82,7 +82,7 @@ void PageLayout::getNextPage(LayoutContext& ctx)
} else {
state.setPage(dom.pages()[state.pageIdx()]);
std::vector<System*>& systems = state.page()->systems();
state.setPageOldMeasure(systems.empty() ? nullptr : systems.back()->measures().back());
state.setPageOldMeasure(systems.empty() || systems.back()->measures().empty() ? nullptr : systems.back()->measures().back());
Copy link
Contributor

Choose a reason for hiding this comment

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

Funny enough almost the same code is used in Mu3.7, came in there via Jojo-Schmitz#391. Back then neither I nor the author @jforberg seem to have realized that Mu4 is suffering from the same issue and needs the same fix

@cbjeukendrup
Copy link
Contributor

But is it valid that a system with no measures ever exists? (Or should I see this as a quick fix before the release and can we do a deeper investigation later?)

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Feb 13, 2025

Also check the video at Jojo-Schmitz#391 (comment)

@miiizen miiizen force-pushed the singleMeasureSystemCrash branch from e8ec26c to 51623c0 Compare February 14, 2025 17:02
@miiizen
Copy link
Contributor Author

miiizen commented Feb 14, 2025

@cbjeukendrup I think it would be better to put the one line fix in 4.5 and put the more thorough clean up in master once 4.5 diverges. I'm not feeling like throwing deletes around where not absolutely necessary this close to release!

@cbjeukendrup
Copy link
Contributor

Yeah, totally fair. Seems indeed too complicated and risky for this phase.

@mike-spa mike-spa merged commit 12ba012 into musescore:master Feb 18, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Issues involving a crash of MuseScore
Projects
Status: Done
5 participants