Bug 1248761 - Destroy VRHMDInfo objects on the compositor thread
- Fixes a crash caused when shutting down the Oculus SDK objects
in a different thread than the one that was used to
initialize them.
MozReview-Commit-ID: DbB2pXVoqxL
--- a/gfx/vr/VRManager.cpp
+++ b/gfx/vr/VRManager.cpp
@@ -80,16 +80,17 @@ VRManager::~VRManager()
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!mInitialized);
MOZ_COUNT_DTOR(VRManager);
}
void
VRManager::Destroy()
{
+ mVRDevices.Clear();
for (uint32_t i = 0; i < mManagers.Length(); ++i) {
mManagers[i]->Destroy();
}
mInitialized = false;
}
void
VRManager::Init()