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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3669>
This commit is contained in:
Florian Müllner 2025-03-16 01:57:55 +01:00
parent 3a452a6b5a
commit 2bff2e5a00

View File

@ -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();
}