From 66ff5ee109a1d753436799e44a32a577c22e5aef Mon Sep 17 00:00:00 2001 From: Rahul Mishra Date: Mon, 5 Feb 2024 18:10:12 +0530 Subject: [PATCH] fix: null out properties in prefs.ts on window close (#10) --- src/prefs.ts | 7 +++++++ 1 file changed, 7 insertions(+) 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; + }); } }