MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Memory Leak in Styled Menus

Open NinjaNas opened this issue 1 year ago • 1 comments

Issue type

Other type of issue

Bug description

By opening and closing any menu that uses StyleMenu, that memory is never released and could eventually crash.

Steps to reproduce

  1. Open task manager and check the memory usage for MS4
  2. Find a menu that uses StyledMenu, for example the file menu
  3. Repeatedly open and close that menu
  4. See that the memory usage for MS4 goes up and never goes back to normal levels

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/54213302/2638d5c9-8e9b-491b-9fb0-41853f04b870

MuseScore Version

OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.3.0-241231433, revision: github-musescore-musescore-5f36e74

Regression

I don't know

Operating system

Windows 10

Additional context

Relevant files may include: src/appshell/view/navigableappmenumodel.cpp

src/appshell/qml/platform/AppMenuBar.qml src/framework/uicomponents/qml/Muse/UiComponents/StyledMenuLoader.qml src/framework/uicomponents/qml/Muse/UiComponents/internal/StyledMenu.qml

Possibly related to this issue as these menus can get stuck open: https://github.com/musescore/MuseScore/issues/20417

Also, it was hidden in the video by the task manager but I was clicking this menu behind it image

NinjaNas avatar May 17 '24 18:05 NinjaNas

Might be related to https://github.com/musescore/MuseScore/commit/2fa36e3371700c49c37ac1a19b1eb47872c772c7: that commit may have fixed this, but sadly it had to be undone in https://github.com/musescore/MuseScore/pull/22681, because it caused big trouble (https://github.com/musescore/MuseScore/issues/22640, https://github.com/musescore/MuseScore/issues/22641)

cbjeukendrup avatar May 17 '24 18:05 cbjeukendrup