[webkit-reviews] review granted: [Bug 21810] Remove use of static C++ objects that are destroyed at exit time (destructors) : [Attachment 25144] WebCore only patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 13 17:03:12 PST 2008


Darin Adler <darin at apple.com> has granted Greg Bolsinga <bolsinga at apple.com>'s
request for review:
Bug 21810: Remove use of static C++ objects that are destroyed at exit time
(destructors)
https://bugs.webkit.org/show_bug.cgi?id=21810

Attachment 25144: WebCore only patch
https://bugs.webkit.org/attachment.cgi?id=25144&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> -static Cursor& leakNamedCursor(const char* name, int x, int y)
> +static Cursor* leakNamedCursor(const char* name, int x, int y)

I think that if you made this return an NSCursor * instead of a Cursor you
could just change the call sites to use the plain old DEFINE_STATIC_LOCAL and
you wouldn't need DEFINE_STATIC_LOCAL_ASSIGN at all.

> -    static Cursor& c = leakNamedCursor("crossHairCursor", 11, 11);
> +    DEFINE_STATIC_LOCAL_ASSIGN(Cursor, c,
(leakNamedCursor("crossHairCursor", 11, 11)));

You don't need the parentheses around the leakNamedCursor call. But really, we
should eliminate the name "leak" from this entirely and use DEFINE_STATIC_LOCAL
if we can.

r=me


More information about the webkit-reviews mailing list