Diff between 4691b95198fa6a801b17b73f259bbaaa3473b205 and 9fbde4dfc6abb121534d26f2641688e1624ce225

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +8 -1 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 4b3f553..8083ff7 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -1934,7 +1934,14 @@ unsigned int bt_gatt_client_ready_register(struct bt_gatt_client *client,
 bool bt_gatt_client_ready_unregister(struct bt_gatt_client *client,
 						unsigned int id)
 {
-	return queue_remove(client->ready_cbs, UINT_TO_PTR(id));
+	struct ready_cb *ready = UINT_TO_PTR(id);
+
+	if (queue_remove(client->ready_cbs, ready)) {
+		ready_destroy(ready);
+		return true;
+	}
+
+	return false;
 }
 
 bool bt_gatt_client_set_service_changed(struct bt_gatt_client *client,