Diff between 3790a1f46ce0105308a45b4dbb9ca769828fa81d and 95749eef62c768eb0f5a0e61654a093264513ded

Changed Files

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

Full Patch

diff --git a/src/gatt-client.c b/src/gatt-client.c
index 4f70aa7..1cd7fbc 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -65,6 +65,7 @@ struct btd_gatt_client {
 
 	struct queue *services;
 	struct queue *all_notify_clients;
+	struct queue *ios;
 };
 
 struct service {
@@ -1169,6 +1170,8 @@ static DBusMessage *characteristic_create_pipe(struct characteristic *chrc,
 						"NotifyAcquired");
 	}
 
+	queue_push_tail(chrc->service->client->ios, io);
+
 	DBG("%s: sender %s io %p", dbus_message_get_member(msg),
 					dbus_message_get_sender(msg), io);
 
@@ -2063,6 +2066,7 @@ struct btd_gatt_client *btd_gatt_client_new(struct btd_device *device)
 	client = new0(struct btd_gatt_client, 1);
 	client->services = queue_new();
 	client->all_notify_clients = queue_new();
+	client->ios = queue_new();
 	client->device = device;
 	ba2str(device_get_address(device), client->devaddr);
 
@@ -2078,6 +2082,7 @@ void btd_gatt_client_destroy(struct btd_gatt_client *client)
 
 	queue_destroy(client->services, unregister_service);
 	queue_destroy(client->all_notify_clients, NULL);
+	queue_destroy(client->ios, NULL);
 	bt_gatt_client_unref(client->gatt);
 	gatt_db_unref(client->db);
 	free(client);
@@ -2199,6 +2204,9 @@ void btd_gatt_client_disconnected(struct btd_gatt_client *client)
 
 	DBG("Device disconnected. Cleaning up.");
 
+	queue_remove_all(client->ios, NULL, NULL,
+				(queue_destroy_func_t) io_shutdown);
+
 	/*
 	 * TODO: Once GATT over BR/EDR is properly supported, we should pass the
 	 * correct bdaddr_type based on the transport over which GATT is being