diff --git a/android/hidhost.c b/android/hidhost.c
index df21f81..d0000a8 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
return true;
}
+static void free_hid_devices(gpointer data, gpointer user_data)
+{
+ struct hid_device *dev = data;
+
+ bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED);
+ hid_device_free(dev);
+}
+
void bt_hid_unregister(void)
{
DBG("");
if (notification_sk < 0)
return;
+ g_slist_foreach(devices, free_hid_devices, NULL);
+ devices = NULL;
notification_sk = -1;
if (ctrl_io) {