Ghost part not attached to any instrument cannot be deleted

• Jan 6, 2023 - 16:18
Reported version
S3 - Major

I have a very strange corruption in a score I'm working on - there is a part that has no corresponding instrument in the score.

  1. Open the attached score
  2. Click File -> Parts
  3. Observe that there is 1 extra part not listed in the instruments, "Melodica 2". This part cannot be deleted with the "..." menu on its row.
  4. Open the part, and see that it does not correspond to any staves in the score

Note that the part in question "Melodica 2" is the same part I was having strange copy/paste segfaults on in I worked around that issue by creating a new part, now "REAL Melodica 2" in the attached score, and deleting the original "Melodica 2", so it could be that the ghost part is somehow a leftover from that operation. The only workaround I can think of is creating a whole new score and copying everything real over to it, which is a big hassle since things like time signature changes can't be copied ( Otherwise I'm considering delving into the xml and trying to fix it there, but I'm a bit afraid of making things worse..

Attachment Size
corrupted_ghost_part.mscz 326.46 KB


It gets even weirder.. when I go into the ghost part "Melodica 2" and clear our the first few measures, it actually propagates some strange changes to the "REAL Melodica 2" part.

Ok, I found it was unsafe to even copy from either the corrupted ghost "Melodica 2" or "REAL Melodica 2" parts, since there was some really broken interlinking between the parts, so my solution was to:
1. Create a new clean instrument
2. Manually rewrite the part without copy/pasting from either the corrupted instruments/parts
3. Delete "REAL Melodica 2"
4. In the XML, delete the Score block for the corrupted ghost "Melodica 2" part
5. Delete corresponding references in the score directory's Excerpts folder and reference in META-INF/container.xml

Now things seem to be actually behaving properly.