Use reference counting of the device object while discovering services
diff --git a/attrib/client.c b/attrib/client.c
index 1f2c217..955e623 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -158,6 +158,7 @@
g_slist_free(gatt->primary);
g_attrib_unref(gatt->attrib);
g_free(gatt->path);
+ btd_device_unref(gatt->dev);
g_free(gatt);
}
@@ -1335,7 +1336,7 @@
device_get_address(device, &dba);
gatt = g_new0(struct gatt_service, 1);
- gatt->dev = device;
+ gatt->dev = btd_device_ref(device);
gatt->listen = FALSE;
gatt->path = g_strdup(path);
bacpy(&gatt->sba, &sba);