From a13638e6ae38f4f5c035bc5fd2532f73f10888b6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 12 Aug 2024 16:01:13 -0400 Subject: [PATCH] shared/uhid: Fix not cleanup input queue on destroy The input queue shall be cleanup on bt_uhid_destroy since that shall not be carried to the next session even if the input node is not destroyed. --- src/shared/uhid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/uhid.c b/src/shared/uhid.c index 4f149fdb8..98d6198c7 100644 --- a/src/shared/uhid.c +++ b/src/shared/uhid.c @@ -504,6 +504,10 @@ int bt_uhid_destroy(struct bt_uhid *uhid, bool force) if (!uhid) return -EINVAL; + /* Cleanup input queue */ + queue_destroy(uhid->input, free); + uhid->input = NULL; + /* Force destroy for non-keyboard devices - keyboards are not destroyed * on disconnect since they can glitch on reconnection losing * keypresses. -- 2.47.3