Commit 5a220321 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

kernel32: Don't release preferred_locales until we're done with its members.

parent 22684cc7
...@@ -2842,12 +2842,8 @@ void LOCALE_Init(void) ...@@ -2842,12 +2842,8 @@ void LOCALE_Init(void)
*/ */
all_locales = CFLocaleCopyAvailableLocaleIdentifiers(); all_locales = CFLocaleCopyAvailableLocaleIdentifiers();
preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL ); preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL );
if (preferred_locales) if (preferred_locales && CFArrayGetCount( preferred_locales ))
{ user_language_string_ref = CFArrayGetValueAtIndex( preferred_locales, 0 );
if (CFArrayGetCount( preferred_locales ))
user_language_string_ref = CFArrayGetValueAtIndex( preferred_locales, 0 );
CFRelease( preferred_locales );
}
CFRelease( all_locales ); CFRelease( all_locales );
#endif /* __APPLE__ */ #endif /* __APPLE__ */
...@@ -2868,6 +2864,8 @@ void LOCALE_Init(void) ...@@ -2868,6 +2864,8 @@ void LOCALE_Init(void)
lcid_LC_MESSAGES = locale_name.lcid; lcid_LC_MESSAGES = locale_name.lcid;
TRACE( "setting lcid_LC_MESSAGES to '%s'\n", user_locale ); TRACE( "setting lcid_LC_MESSAGES to '%s'\n", user_locale );
} }
if (preferred_locales)
CFRelease( preferred_locales );
#endif #endif
NtSetDefaultUILanguage( LANGIDFROMLCID(lcid_LC_MESSAGES) ); NtSetDefaultUILanguage( LANGIDFROMLCID(lcid_LC_MESSAGES) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment