Bug 1248761 - Destroy VRHMDInfo objects on the compositor thread r=daoshengmu
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Thu, 03 Mar 2016 16:58:40 -0800
changeset 338002 eca3a6b94f7934377b099ddb22ae9c91f340cbfc
parent 338001 34f4e17f028560b139289dfcd6cd104baf4460a9
child 338003 4a56c6dc4c7eb19e9b169c77b9001c63bfcfe09e
push id12405
push usercku@mozilla.com
push dateTue, 08 Mar 2016 03:35:29 +0000
reviewersdaoshengmu
bugs1248761
milestone47.0a1
Bug 1248761 - Destroy VRHMDInfo objects on the compositor thread r=daoshengmu - 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()