musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.79k stars 2.56k forks source link

Crash When creating Linked Part in Master #23338

Closed Gai-Luron closed 1 week ago

Gai-Luron commented 1 week ago

Issue type

Crash or freeze

Bug description

Crash When creating Linked Part in Master : OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.4.0-241750505, revision: github-musescore-musescore-6ddd3a6

Steps to reproduce

1 - Create a score with different part. 2 - Create a linked part 3 -Crash

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/1835871/19eeabcc-7adf-447e-966b-1c3c6aa9f3fd

MuseScore Version

MuseScore Studio version (64-bit): 4.4.0-241750505, revision: github-musescore-musescore-6ddd3a6

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

OS: Windows 10 Version 2009 or later, Arch.: x86_64,

Additional context

WOrk in previous version : OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.4.0-241730506, revision: github-musescore-musescore-1c28ffe

cbjeukendrup commented 1 week ago

This turns out to have been caused by https://github.com/musescore/MuseScore/pull/23320. This is what I wrote to @Eism about it this morning: The problem is in DockPanelView::DockPanelMenuModel. I think that what happens is the following:

  1. m_customMenuModel wants to update its items
  2. it deletes its old ones and sets new ones
  3. That triggers DockPanelView::DockPanelMenuModel to set new items.
  4. DockPanelView::DockPanelMenuModel deletes the old items that it contains. Among these old items are the old items from m_customMenuModel. These had already been deleted, so now we’re trying to delete them again.