Changeset 263447 in webkit
- Timestamp:
- Jun 24, 2020 1:50:05 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r263446 r263447 1 2020-06-23 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Fix PlatformXR initialization/destruction 4 https://bugs.webkit.org/show_bug.cgi?id=213509 5 6 Reviewed by Youenn Fablet. 7 8 There were two different issues, one at creation time and the other one at destruction. At creation 9 time we were not calling construct() for the LazyNeverDestroyed object. That was making the WebProcess 10 crash in Debug builds. At destruction time we were calling xrDestroyInstance() without checking that the 11 passed instance was a valid one, although OpenXR implementations deal with it the spec is pretty clear. 12 13 * platform/xr/PlatformXR.h: Mark LazyNeverDestroyed as friend and default constructor&destructor. 14 * platform/xr/openxr/PlatformXROpenXR.cpp: 15 (PlatformXR::Instance::Impl::~Impl): Check that instance is not XR_NULL_HANDLE before destroying. 16 (PlatformXR::Instance::singleton): Call construct() on the Lazy instance. 17 1 18 2020-06-24 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Source/WebCore/platform/xr/PlatformXR.h
r262838 r263447 21 21 #include <memory> 22 22 #include <wtf/HashMap.h> 23 #include <wtf/UniqueRef.h> 23 24 #include <wtf/Vector.h> 24 25 #include <wtf/WeakPtr.h> … … 70 71 const Vector<std::unique_ptr<Device>>& immersiveXRDevices() const { return m_immersiveXRDevices; } 71 72 private: 73 friend LazyNeverDestroyed<Instance>; 72 74 Instance(); 73 ~Instance() ;75 ~Instance() = default; 74 76 75 77 struct Impl; 76 std::unique_ptr<Impl> m_impl;78 UniqueRef<Impl> m_impl; 77 79 78 80 Vector<std::unique_ptr<Device>> m_immersiveXRDevices; -
trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp
r262855 r263447 163 163 Instance::Impl::~Impl() 164 164 { 165 xrDestroyInstance(m_instance); 165 if (m_instance != XR_NULL_HANDLE) 166 xrDestroyInstance(m_instance); 166 167 } 167 168 … … 214 215 std::call_once(s_onceFlag, 215 216 [&] { 216 s_instance ->m_impl = makeUnique<Impl>();217 s_instance.construct(); 217 218 }); 218 219 return s_instance.get(); 219 220 } 220 221 221 Instance::Instance() = default; 222 Instance::~Instance() = default; 222 Instance::Instance() 223 : m_impl(makeUniqueRef<Impl>()) 224 { 225 } 223 226 224 227 void Instance::enumerateImmersiveXRDevices()
Note: See TracChangeset
for help on using the changeset viewer.