From f841bc0b5b7ecd411441d57f719c88c97fc40f6e Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 31 Jan 2021 16:53:02 +0200 Subject: [PATCH] bluez5: remove pipewire device when bluez device disappears The pipewire device holds a pointer to the device, and should be removed when BlueZ removes the underlying device. --- spa/plugins/bluez5/bluez5-dbus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index dc68d3f59..0542f2a4e 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -427,6 +427,8 @@ static struct spa_bt_device *device_create(struct spa_bt_monitor *monitor, const static int device_stop_timer(struct spa_bt_device *device); +static int device_remove(struct spa_bt_monitor *monitor, struct spa_bt_device *device); + static void a2dp_codec_switch_free(struct spa_bt_a2dp_codec_switch *sw); static void device_free(struct spa_bt_device *device) @@ -438,6 +440,7 @@ static void device_free(struct spa_bt_device *device) spa_log_debug(monitor->log, "%p", device); device_stop_timer(device); + device_remove(monitor, device); spa_list_for_each(ep, &device->remote_endpoint_list, device_link) { if (ep->device == device) {