Skip to content

Commit

Permalink
Auto merge of #57 - paulrouget:fixcrash, r=jdm
Browse files Browse the repository at this point in the history
allocate buffer every time

Fix #56
  • Loading branch information
bors-servo committed Sep 18, 2019
2 parents 319b63b + 3ae7160 commit bf4e5a5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions webxr/openxr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@ impl OpenXrDevice {
}

fn handle_openxr_events(&mut self) {
let mut buffer = openxr::EventDataBuffer::new();
while let Some(event) = self.instance.poll_event(&mut buffer).unwrap() {
use openxr::Event::*;
use openxr::Event::*;
loop {
let mut buffer = openxr::EventDataBuffer::new();
let event = self.instance.poll_event(&mut buffer).unwrap();
match event {
SessionStateChanged(session_change) => match session_change.state() {
Some(SessionStateChanged(session_change)) => match session_change.state() {
openxr::SessionState::STOPPING => {
self.events.callback(Event::SessionEnd);
self.session.end().unwrap();
Expand All @@ -280,9 +281,13 @@ impl OpenXrDevice {
// FIXME: Handle other states
}
},
_ => {
Some(_) => {
// FIXME: Handle other events
}
None => {
// No more events to process
break;
}
}
}
}
Expand Down

0 comments on commit bf4e5a5

Please sign in to comment.