session ending works but segfaults on my machine

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2024-05-23 22:05:14 +02:00
parent fb9ec378c8
commit 31c1daf2d4
8 changed files with 64 additions and 20 deletions

View File

@@ -131,7 +131,7 @@ impl Plugin for OxrInitPlugin {
.run_if(status_equals(XrStatus::Ready)),
end_xr_session
.run_if(on_event::<EndXrSession>())
.run_if(status_equals(XrStatus::Stopping)),
.run_if(status_equals(XrStatus::Running)),
destroy_xr_session
.run_if(on_event::<DestroyXrSession>())
.run_if(status_equals(XrStatus::Exiting)),
@@ -489,8 +489,11 @@ pub fn begin_xr_session(session: Res<OxrSession>, session_started: Res<OxrSessio
pub fn end_xr_session(session: Res<OxrSession>, session_started: Res<OxrSessionStarted>) {
let _span = info_span!("xr_end_session");
session.end().expect("Failed to end session");
session_started.set(false);
session
.request_exit()
.expect("Failed to request session exit");
// session.end().expect("Failed to end session");
// session_started.set(false);
}
/// This system transfers important render resources from the main world to the render world when a session is created.