mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
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:
parent
98c6309213
commit
0b402994bb
3 changed files with 336 additions and 222 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-03-12 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
|
||||
* Source/NSNumberFormatter.m: Cache property values and reset them
|
||||
along with the formatter.
|
||||
* Source/NSLocale.m: Add 2 missing unlocks.
|
||||
|
||||
2011-03-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSBlocks.m: Added header
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue