Fix crash on disable when another extension's panel actors are already disposed#2512
Open
wormuz wants to merge 1 commit into
Open
Fix crash on disable when another extension's panel actors are already disposed#2512wormuz wants to merge 1 commit into
wormuz wants to merge 1 commit into
Conversation
…y disposed
When extensions are disabled in an order we don't control (e.g. the snap
firmware-updater notifier disables ubuntu-appindicators on a schedule),
its AppIndicatorsIconActor objects living in the shared panel can be
finalized before dash-to-panel's own disable() runs.
PanelStyle._removeStyles() recursively walks every panel child to restore
styles, touching those already-disposed actors:
TypeError: this._indicator is null
_refreshPanelButton@panelStyle.js
_restoreOriginalStyle@panelStyle.js
_recursiveApply@panelStyle.js
_applyStylesRecursively@panelStyle.js
_removeStyles@panelStyle.js
Accessing a finalized GObject throws ('has been already disposed'),
spamming the journal and breaking the rest of the restore pass.
Add Utils.isValidActor() to probe an actor's liveness and skip dead ones
at the top of _recursiveApply(), plus a null-parent guard in
_refreshPanelButton(). Related to home-sweet-gnome#2439.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the bug
Dash-to-Panel crashes during
disable()when another extension that ownsactors in the shared top panel has already been disabled (and its actors
finalized) before dash-to-panel's turn.
A reliable real-world trigger: the snap
firmware-updaternotifier runs on aschedule and calls
gnome-extensions disable ubuntu-appindicators. ItsAppIndicatorsIconActorobjects are finalized, then dash-to-panel is disabledand
PanelStyle._removeStyles()recursively walks every panel child to restorestyles — touching those dead actors:
Accompanied by repeated:
Accessing a finalized GObject throws, which spams the journal and aborts the
rest of the style-restore pass (panel left half-restored / flickering).
Root cause
_recursiveApply()/_refreshPanelButton()assume every actor reachable fromthe panel is still alive. We don't control the order in which extensions are
disabled, so actors owned by other extensions may already be finalized.
Fix
Utils.isValidActor()— probes whether an actor's underlying GObject isstill alive (touching a finalized one throws).
_recursiveApply()._refreshPanelButton()for actors detached bytheir owning extension.
No behaviour change for live actors; only already-disposed ones are skipped.
Related to #2439 (same class of disposed-actor crashes).
Environment