Fix crash due to missing retain in wxUILocale wxMac code

We need to retain [NSLocale availableLocaleIdentifiers] result too, as
it doesn't copy the returned object.
This commit is contained in:
Vadim Zeitlin
2021-09-10 19:11:42 +02:00
parent b3f609781e
commit 178ac74596

View File

@@ -86,7 +86,7 @@ public:
// completely invalid strings, so we need to check if the name is
// actually in the list of the supported locales ourselves.
static wxCFRef<CFArrayRef>
all((CFArrayRef)[NSLocale availableLocaleIdentifiers]);
all((CFArrayRef)[[NSLocale availableLocaleIdentifiers] retain]);
wxCFStringRef cfName(locId.GetName());
if ( ![(NSArray*)all.get() containsObject: cfName.AsNSString()] )