st/oxr: Destroy compositor on instance destroy

Fixes direct mode on subsequent instance creation in the same process
when no session was created.
This commit is contained in:
Christoph Haag 2020-09-07 15:25:57 +02:00
parent eb8a304178
commit 2b90b4ea89
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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]);