fix: disconnect WindowManager settings handler on disable#523
Open
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Open
fix: disconnect WindowManager settings handler on disable#523mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Conversation
WindowManager._bindSignals() connects to extension.settings without storing the id, mirroring the same leak that forge-ext#521 fixes for FeatureIndicator. Gio.Settings is cached for the lifetime of the gnome-shell process, so each enable/disable cycle accumulates another 'changed' handler firing on prior (disposed) WindowManager instances — toggling tiling-mode-enabled, gap size, focus border, etc. then runs N callbacks against dead objects, each one churning through the settingName switch and eventually faulting in the case branches that touch this.tree / this.theme. Capture the id and disconnect it in _removeSignals().
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.
Summary
Same shape as #521 but in
WindowManager._bindSignals(). Theextension.settings.connect("changed", …)call doesn't capture the handler id, and_removeSignals()doesn't disconnect it. BecauseGio.Settingsis cached for the lifetime of the gnome-shell process, the handler outlives every enable/disable cycle — each cycle adds one more, and toggling any setting (tiling-mode-enabled,window-gap-size,focus-border-toggle, …) eventually fires the switch on disposedWindowManagerinstances.Fix
this._settingsChangedIdat connect time._removeSignals()alongside the existing display / window_manager / workspace_manager / overview cleanups.Test plan
node --checkgnome-extensions disable forge && gnome-extensions enable forgecycles, then togglingtiling-mode-enabled: settings change runs once per toggle (not N times).JS ERRORrows in the journal mentioningtree/renderTreeafter several reload cycles.Notes
Together with #521, this clears all settings-handler leaks I could find. There's no remaining
*.connect("changed"without a paired disconnect after these two PRs.