RESOLVED FIXED223211
Protect this in all PlatformOpenXR queue->dispatch() calls
https://bugs.webkit.org/show_bug.cgi?id=223211
Summary Protect this in all PlatformOpenXR queue->dispatch() calls
Imanol Fernandez
Reported 2021-03-15 13:25:36 PDT
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.
Attachments
Patch (9.11 KB, patch)
2021-03-15 13:37 PDT, Imanol Fernandez
no flags
Patch (9.04 KB, patch)
2021-03-15 13:55 PDT, Imanol Fernandez
no flags
Imanol Fernandez
Comment 1 2021-03-15 13:37:49 PDT
Chris Dumez
Comment 2 2021-03-15 13:42:23 PDT
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`.
Imanol Fernandez
Comment 3 2021-03-15 13:55:00 PDT
Created attachment 423233 [details] Patch Thanks for the quick review! I added ThreadSafeRefCounted and removed the unneeded virtual destructor in the inherited class
Chris Dumez
Comment 4 2021-03-15 14:00:07 PDT
Comment on attachment 423233 [details] Patch r=me if the bots are happy.
EWS
Comment 5 2021-03-16 01:45:56 PDT
Committed r274470: <https://commits.webkit.org/r274470> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423233 [details].
Radar WebKit Bug Importer
Comment 6 2021-03-16 01:46:15 PDT
Note You need to log in before you can comment on or make changes to this bug.