mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-21 06:01:43 +00:00
d/vive: Make sure to properly destroy controller
This commit is contained in:
parent
a89c8309c7
commit
d61cf5dc78
|
@ -1076,7 +1076,7 @@ vive_controller_create(struct os_hid_device *controller_hid, enum watchman_gen w
|
||||||
|
|
||||||
if (vive_get_imu_range_report(d->controller_hid, &d->config.imu.gyro_range, &d->config.imu.acc_range) != 0) {
|
if (vive_get_imu_range_report(d->controller_hid, &d->config.imu.gyro_range, &d->config.imu.acc_range) != 0) {
|
||||||
// reading range report fails for powered off controller
|
// reading range report fails for powered off controller
|
||||||
free(d);
|
vive_controller_device_destroy(&d->base);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,7 +1091,7 @@ vive_controller_create(struct os_hid_device *controller_hid, enum watchman_gen w
|
||||||
free(config);
|
free(config);
|
||||||
} else {
|
} else {
|
||||||
VIVE_ERROR(d, "Could not get Vive controller config\n");
|
VIVE_ERROR(d, "Could not get Vive controller config\n");
|
||||||
free(d);
|
vive_controller_device_destroy(&d->base);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue