diff --git a/android/gatt.c b/android/gatt.c
index d958965..7f8f99f 100644
--- a/android/gatt.c
+++ b/android/gatt.c
guint ind_id;
int ref;
- int conn_cnt;
struct queue *autoconnect_apps;
if (conn->timeout_id > 0)
g_source_remove(conn->timeout_id);
- conn->device->conn_cnt--;
- if (conn->device->conn_cnt == 0)
+ if (!queue_find(app_connections, match_connection_by_device,
+ conn->device))
connection_cleanup(conn->device);
queue_destroy(conn->transactions, free);
}
new_conn->device = device_ref(device);
- new_conn->device->conn_cnt++;
return new_conn;
}
*/
queue_foreach(dev->autoconnect_apps, create_app_connection, dev);
- if (!dev->conn_cnt) {
+ if (!queue_find(app_connections, match_connection_by_device, dev)) {
struct app_connection *conn;
if (!dev->attrib)