Bug 1427830 - If VR submit thread is inactive in Oculus, don't post tasks; r?kip
MozReview-Commit-ID: BKaD7ft3Fms
--- a/gfx/vr/gfxVROculus.cpp
+++ b/gfx/vr/gfxVROculus.cpp
@@ -385,24 +385,24 @@ VROculusSession::Refresh(bool aForceRefr
// traversal.
bInvisible = false;
// While we are waiting for either the timeout or a new presentation,
// fill the HMD with black / no layers.
if (mSession && mTextureSet) {
if (!aForceRefresh) {
// VROculusSession didn't start submitting frames yet.
- if (!mSubmitThread) {
+ // Or, the VR thread has been shut down already.
+ if (!mSubmitThread || !mSubmitThread->IsActive()) {
return;
}
// ovr_SubmitFrame is running at VR Submit thread,
// so we post this task to VR Submit thread and let it paint
// a black frame.
mDrawBlack = true;
- MOZ_ASSERT(mSubmitThread->IsActive());
mSubmitThread->PostTask(NewRunnableMethod<bool>(
"gfx::VROculusSession::Refresh",
this,
&VROculusSession::Refresh, true));
return;
}
ovrLayerEyeFov layer;
memset(&layer, 0, sizeof(layer));