fix: disconnect FeatureIndicator settings handler + correct theme cleanup#521
Open
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Open
fix: disconnect FeatureIndicator settings handler + correct theme cleanup#521mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
Conversation
Two small lifecycle fixes that surface during repeated enable/disable cycles (e.g. while iterating on the extension during development): 1. FeatureIndicator.constructor connects to `extension.settings` without storing the handler id. `Gio.Settings` returned by `getSettings()` is cached for the lifetime of the gnome-shell process, so the handler outlives the indicator: each cycle accumulates another callback, all firing on previous (destroyed) indicators when the user toggles tiling-mode-enabled or quick-settings-enabled. Track the id and disconnect in destroy(). 2. extension.js disable() set `this.themeWm = null`, but the field assigned in enable() is `this.theme` (an ExtensionThemeManager). The original statement was a typo / no-op leaving the real reference dangling on the extension object after disable. Replace with `this.theme = null`. Both are zero-behaviour changes for the happy path; they only affect state cleanup at disable time.
This was referenced Apr 29, 2026
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
Two small lifecycle fixes that surface during repeated
enable/disablecycles (a common path during development, plus user-triggered prefs reloads or extension scans).1.
FeatureIndicatorleaks asettingssignal handlerindicator.jsconnects toextension.settings.connect("changed", …)in the constructor without storing the handler id.Gio.Settingsreturned bygetSettings()is cached for the lifetime of the gnome-shell process, so the handler outlives the indicator. Everyenable/disablecycle adds another listener; togglingtiling-mode-enabledorquick-settings-enabledthen fires N callbacks, each operating on a previous (destroyed) indicator object.Fix: store the id, override
destroy()to disconnect.2.
extension.jsdisable() typo:themeWminstead ofthemeenable()assignsthis.theme = new ExtensionThemeManager(this), butdisable()was clearingthis.themeWm = null— a no-op that leftthis.themereferencing the manager after disable. Replaced withthis.theme = nulland added a comment explaining the previous typo.Test plan
node --checkon both touched files.gnome-extensions disable forge@jmmaranan.com && gnome-extensions enable forge@jmmaranan.comrepeated several times — no journal warnings abouttiling-mode-enabledcallbacks firing on destroyed objects.Super+Tafter multiple reloads — only one settings listener active.Notes