Crash when closing a score after trying to delete a spacer on a reordered instrument

Open
#35,849 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@ajuncosa is already working on this.

Since Dec 1, 2026.

Assessment

This issue has not been assessed yet.

Description

crash P1
Issue type

Crash or freeze

Description with steps to reproduce
  1. Create a score with two instruments
  2. Add a Staff spacer down to b.1 of the upper instrument
  3. In the Layout panel, move the upper instrument below the other one
  4. Select the spacer and press Delete

Result: The spacer isn't deleted.

  1. Close the score without saving

Result: Crash.

Supporting files, videos and screenshots

https://github.com/user-attachments/assets/e9ee9ca0-8c61-4ab6-a153-05ef6fd1d709

In which versions of MuseScore Studio is this issue present?

Reproduced in 4.6.5, 4.7.7 and nightly main

Regression

No.

Operating system

macOS 27.2.1

Additional context
  • With #35184, replacing a spacer after reordering instruments is also affected: a spacer on another staff can be removed, and undo puts the original spacer back on the wrong staff.
Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
Dominant language
C++
Stars
15.5k
Forks
3.5k
Avg merge
2d 19h
Merged PRs (30d)
124

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from musescore/MuseScore

All issues in musescore/MuseScore

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.