If such a protection is really needed, then it might should be better
handled properly within GDBus. So remove it and if it causes an issue,
fix it then.
void btd_device_unref(struct btd_device *device)
{
- char *path;
-
device->ref--;
DBG("%p: ref=%d", device, device->ref);
if (device->ref > 0)
return;
- path = g_strdup(device->path);
-
- g_dbus_unregister_interface(dbus_conn, path, DEVICE_INTERFACE);
-
- g_free(path);
+ g_dbus_unregister_interface(dbus_conn, device->path, DEVICE_INTERFACE);
}
int device_get_appearance(struct btd_device *device, uint16_t *value)