diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c index fb9e5f7dd..401ad974a 100644 --- a/src/xrt/state_trackers/oxr/oxr_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_instance.c @@ -68,6 +68,9 @@ oxr_instance_destroy(struct oxr_logger *log, struct oxr_handle_base *hb) { struct oxr_instance *inst = (struct oxr_instance *)hb; + // Does a null-ptr check. + xrt_comp_destroy((struct xrt_compositor **)&inst->system.xcn); + u_var_remove_root((void *)inst); oxr_binding_destroy_all(log, inst); diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index 0640b94e7..58c18cbb9 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -1830,8 +1830,6 @@ oxr_session_destroy(struct oxr_logger *log, struct oxr_handle_base *hb) XrResult ret = oxr_event_remove_session_events(log, sess); - // Does a null-ptr check. - xrt_comp_destroy(&sess->compositor); for (size_t i = 0; i < sess->num_action_set_attachments; ++i) { oxr_action_set_attachment_teardown( &sess->act_set_attachments[i]);