diff --git a/src/xrt/state_trackers/oxr/oxr_api_verify.h b/src/xrt/state_trackers/oxr/oxr_api_verify.h index ccb508d45e095bf057cd9f3d7f0f96caf52cc285..8da93b0f34e3654df2d2274182056a48a35f0a39 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_verify.h +++ b/src/xrt/state_trackers/oxr/oxr_api_verify.h @@ -28,6 +28,13 @@ extern "C" { "(" #thing " == %p)", \ (void*)new_thing); \ } \ + if (new_thing->handle.state != OXR_HANDLE_STATE_LIVE) { \ + return oxr_error(log, XR_ERROR_HANDLE_INVALID, \ + " state == %s (" #thing " == %p)", \ + oxr_handle_state_to_string( \ + new_thing->handle.state), \ + (void*)new_thing); \ + } \ oxr_log_set_instance(log, lookup); \ } while (0)