diff --git a/src/prefs.ts b/src/prefs.ts index cb8a0a1..d0ce3a2 100644 --- a/src/prefs.ts +++ b/src/prefs.ts @@ -123,5 +123,12 @@ export default class BluetoothQuickConnectPreferences extends ExtensionPreferenc group.add(widget); page.add(group); window.add(page); + window.connect("close-request", () => { + // @ts-expect-error, GJS disposal + this._extension = null; + this._settings = null; + this._builder = null; + this._widget = null; + }); } }