Fix crash in iOS Capabilities.language (fixes #464)

This commit is contained in:
Joshua Granick
2015-01-10 00:20:46 -08:00
parent 633cd9c772
commit c45e1a4db0

View File

@@ -22,13 +22,13 @@ bool LaunchBrowser(const char *inUtf8URL)
std::string CapabilitiesGetLanguage()
{
#ifndef OBJC_ARC
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
#endif
NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
std::string result(language?[language UTF8String]:"");
#ifndef OBJC_ARC
[language release];
[pool drain];
//[pool drain];
#endif
return result;
}