Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2391)

Unified Diff: Source/platform/text/LocaleMac.mm

Issue 139243002: StringImpl should not be referred from StringImplCF. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/text/LocaleMac.mm
diff --git a/Source/platform/text/LocaleMac.mm b/Source/platform/text/LocaleMac.mm
index 48cad200c9178761b7678ce752347d8a9229ac9e..a9d40d3f38103eedcdfbe716c18dfc26c2194366 100644
--- a/Source/platform/text/LocaleMac.mm
+++ b/Source/platform/text/LocaleMac.mm
@@ -88,8 +88,10 @@ LocaleMac::LocaleMac(NSLocale* locale)
NSArray* availableLanguages = [NSLocale ISOLanguageCodes];
// NSLocale returns a lower case NSLocaleLanguageCode so we don't have care about case.
NSString* language = [m_locale.get() objectForKey:NSLocaleLanguageCode];
- if ([availableLanguages indexOfObject:language] == NSNotFound)
- m_locale.adoptNS([[NSLocale alloc] initWithLocaleIdentifier:defaultLanguage()]);
+ if ([availableLanguages indexOfObject:language] == NSNotFound) {
+ NSString *nsLanguage = [[NSString alloc] initWithUTF8String:defaultLanguage().utf8().data()];
Nico 2014/01/15 19:06:12 This too leaks
tasak 2014/01/17 08:17:29 Done.
+ m_locale.adoptNS([[NSLocale alloc] initWithLocaleIdentifier:nsLanguage]);
+ }
[m_gregorianCalendar.get() setLocale:m_locale.get()];
}

Powered by Google App Engine
This is Rietveld 408576698