From: Joseph Hwang <josephsih@xxxxxxxxxxxx> A disconnecting flag has been used to avoid race condition between the service browsing thread and the disconnecting thread. We need to unset the flag when connection is removed. --- src/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/device.c b/src/device.c index 7b7808405..5ab591dd4 100644 --- a/src/device.c +++ b/src/device.c @@ -3041,6 +3041,9 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) "Paired"); } + if (device) + set_client_diconnecting(device->client, false); + if (device->bredr_state.connected || device->le_state.connected) return; -- 2.26.2