Add a hack to reset formatter properties along with the formatter itself. This can't be the best way to go about this so feel free to provide input for a better solution. Also added 2 missing unlocks in NSLocale.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Stefan Bidigaray 2011-03-12 14:22:21 +00:00
parent 98c6309213
commit 0b402994bb
3 changed files with 336 additions and 222 deletions

View file

@ -475,22 +475,23 @@ static NSRecursiveLock *classLock = nil;
if (nil == countries)
{
#if GS_USE_ICU == 1
[classLock lock];
if (nil == countries)
{
#if GS_USE_ICU == 1
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity: 10];
const char *const *codes = uloc_getISOCountries ();
{
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity: 10];
const char *const *codes = uloc_getISOCountries ();
while (codes != NULL)
{
[array addObject: [NSString stringWithUTF8String: *codes]];
++codes;
}
countries = [[NSArray alloc] initWithArray: array];
[array release];
while (codes != NULL)
{
[array addObject: [NSString stringWithUTF8String: *codes]];
++codes;
}
countries = [[NSArray alloc] initWithArray: array];
[array release];
}
[classLock unlock];
#endif
}
}
return [[countries copy] autorelease];
}
@ -501,22 +502,23 @@ static NSRecursiveLock *classLock = nil;
if (nil == languages)
{
#if GS_USE_ICU == 1
[classLock lock];
if (nil == languages)
{
#if GS_USE_ICU == 1
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity: 10];
const char *const *codes = uloc_getISOCountries ();
{
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity: 10];
const char *const *codes = uloc_getISOCountries ();
while (codes != NULL)
{
[array addObject: [NSString stringWithUTF8String: *codes]];
++codes;
}
languages = [[NSArray alloc] initWithArray: array];
[array release];
while (codes != NULL)
{
[array addObject: [NSString stringWithUTF8String: *codes]];
++codes;
}
languages = [[NSArray alloc] initWithArray: array];
[array release];
}
[classLock unlock];
#endif
}
}
return [[languages copy] autorelease];
}