Stop using DEFINE_STATIC_LOCAL with RetainPtr
Created attachment 208669 [details]
Committed r154021: <http://trac.webkit.org/changeset/154021>
Can we come up with a trick that makes it a compile error to make this error?
(In reply to comment #3)
> Can we come up with a trick that makes it a compile error to make this error?
I’m not sure. There are (currently) some places where we legitimately use DEFINE_STATIC_LOCAL with smart pointer types, for example:
static RetainPtr<NSEvent>& currentNSEventSlot()
DEFINE_STATIC_LOCAL(RetainPtr<NSEvent>, event, ());
I think we can just use NeverDestroyed for those cases though.
We can use NeverDestroyed everywhere instead of DEFINE_STATIC_LOCAL; maybe that’s what we should do first.