Skip to content

Commit

Permalink
device: Don't remove object if a service is connecting
Browse files Browse the repository at this point in the history
If a service is connecting just restart the timer to give it more time
to complete the connection or disconnect.
  • Loading branch information
Vudentz committed Feb 2, 2024
1 parent 17c1a9b commit 59bf065
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/device.c
Expand Up @@ -3276,6 +3276,13 @@ static bool device_disappeared(gpointer user_data)
{
struct btd_device *dev = user_data;

/* If there are services connecting restart the timer to give more time
* for the service to either complete the connection or disconnect.
*/
if (find_service_with_state(dev->services,
BTD_SERVICE_STATE_CONNECTING))
return TRUE;

dev->temporary_timer = 0;

btd_adapter_remove_device(dev->adapter, dev);
Expand Down

0 comments on commit 59bf065

Please sign in to comment.