RESOLVED FIXED 119765
Stop using DEFINE_STATIC_LOCAL with RetainPtr
https://bugs.webkit.org/show_bug.cgi?id=119765
Summary Stop using DEFINE_STATIC_LOCAL with RetainPtr
Anders Carlsson
Reported 2013-08-13 13:40:51 PDT
Stop using DEFINE_STATIC_LOCAL with RetainPtr
Attachments
Patch (6.38 KB, patch)
2013-08-13 13:43 PDT, Anders Carlsson
jberlin: review+
Anders Carlsson
Comment 1 2013-08-13 13:43:05 PDT
Anders Carlsson
Comment 2 2013-08-13 13:58:00 PDT
Darin Adler
Comment 3 2013-08-13 13:59:10 PDT
Can we come up with a trick that makes it a compile error to make this error?
Anders Carlsson
Comment 4 2013-08-13 14:16:39 PDT
(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, ()); return event; } I think we can just use NeverDestroyed for those cases though.
Darin Adler
Comment 5 2013-08-13 16:39:55 PDT
We can use NeverDestroyed everywhere instead of DEFINE_STATIC_LOCAL; maybe that’s what we should do first.
Note You need to log in before you can comment on or make changes to this bug.