Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix Oculus layers array stack overflow (#1764)
Browse files Browse the repository at this point in the history
* Fix Oculus layers array stack overflow

* It's preferable to hide the windows first to avoid max layers race conditions
  • Loading branch information
MortimerGoro authored and bluemarvin committed Sep 4, 2019
1 parent 63542e4 commit 66a6788
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@ public void exitPrivateMode() {
} else {
mPrivateWindowPlacement = WindowPlacement.FRONT;
}
for (WindowWidget window: mRegularWindows) {
setWindowVisible(window, true);
}
for (WindowWidget window: mPrivateWindows) {
setWindowVisible(window, false);
}
for (WindowWidget window: mRegularWindows) {
setWindowVisible(window, true);
}
focusWindow(getWindowWithPlacement(mRegularWindowPlacement));
updateViews();
mWidgetManager.popWorldBrightness(this);
Expand Down
2 changes: 1 addition & 1 deletion app/src/oculusvr/cpp/DeviceDelegateOculusVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ DeviceDelegateOculusVR::EndFrame(const bool aDiscard) {

// Draw back layers
for (const OculusLayerPtr& layer: m.uiLayers) {
if (!layer->GetDrawInFront() && layer->IsDrawRequested() && layerCount < ovrMaxLayerCount) {
if (!layer->GetDrawInFront() && layer->IsDrawRequested() && (layerCount < ovrMaxLayerCount - 1)) {
layer->Update(m.predictedTracking);
layers[layerCount++] = layer->Header();
layer->ClearRequestDraw();
Expand Down

0 comments on commit 66a6788

Please sign in to comment.