The open source OpenXR runtime

h/mercury: Fix crash when hand tracker init fails master

HandTracking leaves pool, group and kinematic_hands uninitialized unless t_hand_tracking_sync_mercury_create() fully succeeds. If an exception is thrown while loading the ONNX models, create() deletes the partially built object and ~HandTracking() then calls optimizer_destroy() on the garbage kinematic_hands pointers (and releases group), which segfaults in free(). Initialize these members to nullptr so a partially constructed HandTracking is safe to destroy. Signed-off-by: Timo Witte <timo.witte@gmail.com> Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/3007>


+3 -3
1 changed file