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.
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):
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 itsenable(), which firesSt.ThemeContext "changed"— andSelectionTilePreview._recolor()runs on a preview object that was already disposed during teardown.Root cause: the ThemeContext signal connection is only disconnected on the JS
destroysignal:When the actor is disposed from C during extension teardown,
destroynever fires, the connection leaks, and the next theme change calls_recolor()(which doesthis.set_style(null)/get_theme_node()) on a dead object.Suggested fix: guard
_recolor()against the disposed state (checkthis._destroyedor wrap in try/catch), and/or disconnect the signal indispose()rather than relying solely ondestroy.