As discussed in https://bugs.webkit.org/show_bug.cgi?id=222607, the WorkQueue may outlive OpenXRDevice so m_queue->dispatch([this] { /*do something with this*/}); is unsafe.
Created attachment 423231 [details] Patch
Comment on attachment 423231 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423231&action=review > Source/WebCore/platform/xr/PlatformXR.h:65 > +class Device : public RefCounted<Device>, public CanMakeWeakPtr<Device> { You want ThreadSafeRefCounted since you are passing this to another thread. > Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h:50 > + virtual ~OpenXRDevice(); I don't think we need the `virtual`.
Created attachment 423233 [details] Patch Thanks for the quick review! I added ThreadSafeRefCounted and removed the unneeded virtual destructor in the inherited class
Comment on attachment 423233 [details] Patch r=me if the bots are happy.
Committed r274470: <https://commits.webkit.org/r274470> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423233 [details].
<rdar://problem/75468705>