st/oxr: Don't go to READY after EXITING

The STOPPING state has two possible follow up paths:

STOPPING -> IDLE -> READY
STOPPING -> IDLE -> EXITING

After EXITING, the application must call xrDestroySession; there is no meaningful
session state after EXITING.

To go to the READY state again, the application should first create a new session.

Applications that are lazy and drain the entire event queue and only handle
the last encountered state would be affected by "skipping" the EXITING state.
This commit is contained in:
Christoph Haag 2021-06-29 01:50:23 +02:00 committed by Jakob Bornecrantz
parent 184d155bd1
commit 250ef94d71

View file

@ -188,10 +188,10 @@ oxr_session_end(struct oxr_logger *log, struct oxr_session *sess)
oxr_session_change_state(log, sess, XR_SESSION_STATE_IDLE);
if (sess->exiting) {
oxr_session_change_state(log, sess, XR_SESSION_STATE_EXITING);
} else {
oxr_session_change_state(log, sess, XR_SESSION_STATE_READY);
}
oxr_session_change_state(log, sess, XR_SESSION_STATE_READY);
sess->has_begun = false;
return oxr_session_success_result(sess);