[webkit-reviews] review granted: [Bug 97628] Fix leaking NSLocale in LocaleMac : [Attachment 165728] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 26 23:15:54 PDT 2012


Kent Tamura <tkent at chromium.org> has granted Keishi Hattori
<keishi at webkit.org>'s request for review:
Bug 97628: Fix leaking NSLocale in LocaleMac
https://bugs.webkit.org/show_bug.cgi?id=97628

Attachment 165728: Patch
https://bugs.webkit.org/attachment.cgi?id=165728&action=review

------- Additional Comments from Kent Tamura <tkent at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=165728&action=review


> Source/WebCore/ChangeLog:14
> +	   (WebCore::determineLocale):
> +	   (WebCore::LocaleMac::LocaleMac):

Please write why you changed.

> Source/WebCore/platform/text/mac/LocaleMac.mm:64
> +	   return [currentLocale retain];

ok
The returned object will be held by a RetainPtr, which will release the object
later. So we need to retain here.

> Source/WebCore/platform/text/mac/LocaleMac.mm:86
> +    : m_locale(AdoptNS, locale)

ok
We should use the constructor with AdoptNS for NS* objects.

> Source/WebCore/platform/text/mac/LocaleMac.mm:93
> +	   m_locale.adoptNS([[NSLocale alloc]
initWithLocaleIdentifier:defaultLanguage()]);

ok.
RetainPtr::operator= doesn't call adoptNSReference().  We need to use adoptNS()
for NS* objects.


More information about the webkit-reviews mailing list