From 2bff2e5a009c0ba457e8cee33ba2040dfc022844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 16 Mar 2025 01:57:55 +0100 Subject: [PATCH] status/bluetooth: Disconnect device signals on destroy Devices may outlive the corresponding menu item, for example on shutdown. Make sure that signals are disconnected correctly in that case to avoid warnings. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8223 Part-of: --- js/ui/status/bluetooth.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js index 794c08cbe..90e7e9f4b 100644 --- a/js/ui/status/bluetooth.js +++ b/js/ui/status/bluetooth.js @@ -248,8 +248,10 @@ class BluetoothDeviceItem extends PopupMenu.PopupBaseMenuItem { this.connect('destroy', () => (this._spinner = null)); this.connect('activate', () => this._toggleConnected().catch(logError)); - this._device.connect('notify::alias', () => this._updateAccessibleName()); - this._device.connect('notify::connected', () => this._updateAccessibleName()); + this._device.connectObject( + 'notify::alias', () => this._updateAccessibleName(), + 'notify::connected', () => this._updateAccessibleName(), + this); this._updateAccessibleName(); }