steamvr_lh: add frame mutex to prevent double free

This commit is contained in:
BabbleBones 2023-09-27 01:11:24 -04:00 committed by Jakob Bornecrantz
parent 3adfd58bcc
commit 4c1c593bf4
2 changed files with 3 additions and 0 deletions

View file

@ -372,6 +372,7 @@ ControllerDevice::set_haptic_handle(vr::VRInputComponentHandle_t handle)
void
Device::update_inputs()
{
std::lock_guard<std::mutex> lock(frame_mutex);
ctx->maybe_run_frame(++current_frame);
}

View file

@ -87,6 +87,8 @@ private:
std::vector<xrt_binding_profile> binding_profiles_vec;
uint64_t current_frame{0};
std::mutex frame_mutex;
void
init_chaperone(const std::string &steam_install);
};