Bug 1248761 - Destroy VRHMDInfo objects on the compositor thread draft
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Thu, 03 Mar 2016 16:58:40 -0800
changeset 336650 d1ee8f89462418912010c2856a6df95643b1192e
parent 336498 2b5237c178ea02133a777396c24dd2b713f2b8ee
child 515484 0b1e36093c4af3c25c2f5ea35837c6fbb53aa146
push id12163
push userkgilbert@mozilla.com
push dateFri, 04 Mar 2016 00:58:51 +0000
bugs1248761
milestone47.0a1
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
gfx/vr/VRManager.cpp
--- 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()