Skip to content

SelectionTilePreview crash: "has been already disposed" when another extension reloads a stylesheet during screen unlock #602

Description

@louquillio

SelectionTilePreview crash: "has been already disposed" when another extension reloads a stylesheet during screen unlock

Environment: GNOME Shell 46 (Zorin OS 18.1, zorin-tiling-shell — same code as upstream src/components/tilepreview/selectionTilePreview.ts)

Error (repeated):

Object .SelectionTilePreview (0x…) has been already disposed — impossible to access it.
#0 selectionTilePreview.js:52 (_recolor)
#1 selectionTilePreview.js:21  (ThemeContext 'changed' handler)

The extension then enters ERROR state: snap-assist drop targets render blank (empty drag panel), and the tiling work area stops updating.

Trigger: screen unlock. The session-mode pop re-enables all extensions; another extension (highlight-focus) calls theme.load_stylesheet() during its enable(), which fires St.ThemeContext "changed" — and SelectionTilePreview._recolor() runs on a preview object that was already disposed during teardown.

Root cause: the ThemeContext signal connection is only disconnected on the JS destroy signal:

this.connect('destroy', () => St.ThemeContext…disconnect(styleChangedSignalID));

When the actor is disposed from C during extension teardown, destroy never fires, the connection leaks, and the next theme change calls _recolor() (which does this.set_style(null) / get_theme_node()) on a dead object.

Suggested fix: guard _recolor() against the disposed state (check this._destroyed or wrap in try/catch), and/or disconnect the signal in dispose() rather than relying solely on destroy.

AI-assisted issue — drafted by Hermes Agent (Nous Research) on behalf of @louquillio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions