Skip to content

popupMenu: release destroyed item signals - #13958

Open
H234598 wants to merge 4 commits into
linuxmint:masterfrom
H234598:fix/popup-menu-signal-retention
Open

H234598 wants to merge 4 commits into
linuxmint:masterfrom
H234598:fix/popup-menu-signal-retention

Conversation

@H234598

@H234598 H234598 commented Aug 26, 2026 •

Copy link
Copy Markdown

Repeated menu rebuilds retain destroyed menu items through managed signal connections. Destroying a submenu can also disconnect parent state handlers that still belong to its siblings.

This change disconnects all parent-managed signals associated with destroyed items, child menus, and sections. A single menu-lifetime handler updates separator visibility and closes submenus, including those inside sections, while preserving the deferred close path used during animations.

Closes #13956.

Regression tests

The regression suite and isolated Xvfb/D-Bus runner are available separately on the tests/popup-menu-signals branch in my fork.

The suite covers 1,000 add/destroy cycles for each of four item types, sibling submenu handling after another submenu is destroyed, separator updates, submenu closure inside sections, and animated/deferred parent closure.

To run the preserved suite:

git clone --branch tests/popup-menu-signals --single-branch https://github.com/H234598/cinnamon.git cinnamon-popup-menu-tests
cd cinnamon-popup-menu-tests
./tests/run-popup-menu-signals.sh

The standalone runner uses the installed Cinnamon runtime and the branch's popup menu implementation. It requires Cinnamon, Xvfb, gdbus, dbus-run-session, setsid, and timeout; it includes compatibility adjustments for running the checkout's popup menu code against the installed Cinnamon 6.6 runtime.

@mtwebster

Copy link
Copy Markdown
Member

Hi can you drop the tests please, just the popupMenu.js changes.

Thanks

@hubyhuby

hubyhuby commented Oct 11, 2026 •

Copy link
Copy Markdown

Field validation from #14026, the same bug, triggered by the power applet and Bluetooth devices that report their battery level:

I ran the minimal version of this fix (this._signals.disconnect('destroy', menuItem) in _connectItemSignals) on 6.6.9 for 7 days. cinnamon RssAnon stays around 100 MB. Without the fix it reaches ~500 MB within about 4 hours and the session freezes.

@H234598, are you planning to drop the tests as requested?

Preserve the regression suite and isolated Xvfb/D-Bus runner on the tests/popup-menu-signals branch for separate reproduction.

The popupMenu.js implementation is unchanged.
@H234598

H234598 commented Oct 11, 2026

Copy link
Copy Markdown
Author

sure thing, sorry for the delay.

I've removed the two test files as requested, so this PR now contains only the changes to js/ui/popupMenu.js.

The regression tests and isolated Xvfb/D-Bus runner are preserved on the tests/popup-menu-signals branch in my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PopupMenuBase retains destroyed items and disconnects sibling state handlers

3 participants