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

This commit is contained in:
Ken Thomases 2007-01-08 22:28:07 -06:00 committed by Alexandre Julliard
parent 22684cc767
commit 5a220321df
1 changed files with 4 additions and 6 deletions

View File

@ -2842,12 +2842,8 @@ void LOCALE_Init(void)
*/
all_locales = CFLocaleCopyAvailableLocaleIdentifiers();
preferred_locales = CFBundleCopyLocalizationsForPreferences( all_locales, NULL );
if (preferred_locales)
{
if (CFArrayGetCount( preferred_locales ))
user_language_string_ref = CFArrayGetValueAtIndex( preferred_locales, 0 );
CFRelease( preferred_locales );
}
if (preferred_locales && CFArrayGetCount( preferred_locales ))
user_language_string_ref = CFArrayGetValueAtIndex( preferred_locales, 0 );
CFRelease( all_locales );
#endif /* __APPLE__ */
@ -2868,6 +2864,8 @@ void LOCALE_Init(void)
lcid_LC_MESSAGES = locale_name.lcid;
TRACE( "setting lcid_LC_MESSAGES to '%s'\n", user_locale );
}
if (preferred_locales)
CFRelease( preferred_locales );
#endif
NtSetDefaultUILanguage( LANGIDFROMLCID(lcid_LC_MESSAGES) );