Commit d73b4e2d authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Fix AccessViolation in WMR UpdateVisibilityState

While the runtime is stopping if the current sensor presence state is
anything other than "NotPresent", a visibility state change event comes
in.  This event gets unsubscribed in StopRuntime, but it's possible that
the change comes in before the render loop knows that it needs to tear
down the runtime, so simply unsubscribing earlier is insufficient to fix
this. The fix is to just simply check whether or not holographic_space_
is valid before running the rest of the logic.

Fixed: 1018822
Change-Id: I05298c6f20419cbad30cda3107924d0e207aaa2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884288
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jacob DeWitt <jacde@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarJacob DeWitt <jacde@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710069}
parent 585ed401
......@@ -414,6 +414,14 @@ void MixedRealityRenderLoop::OnUserPresenceChanged() {
}
void MixedRealityRenderLoop::UpdateVisibilityState() {
// We could've had a task get queued up during or before a StopRuntime call.
// Which would lead to the holographic space being null. In that case, don't
// update the visibility state. We'll get the fresh state when and if the
// runtime starts back up again.
if (!holographic_space_) {
return;
}
switch (holographic_space_->UserPresence()) {
// Indicates that the browsers immersive content is visible in the headset
// receiving input, and the headset is being worn.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment