Summary: | Stop using DEFINE_STATIC_LOCAL with RetainPtr | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Anders Carlsson
2013-08-13 13:40:51 PDT
Created attachment 208669 [details]
Patch
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, ()); return 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. |