mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-27 18:50:47 +00:00
Minor memory management fixed to NSLocale.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31955 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c03e3a89fe
commit
94e9bf5c50
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2011-01-26 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSLocale.m: Minor memory mgt fixes.
|
||||||
|
|
||||||
2011-01-24 Stefan Bidigaray <stefanbidi@gmail.com>
|
2011-01-24 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||||
|
|
||||||
* Source/NSNumberFormatter.m: Fixes for formatter behavior.
|
* Source/NSNumberFormatter.m: Fixes for formatter behavior.
|
||||||
|
|
|
@ -503,7 +503,8 @@ static NSRecursiveLock *classLock = nil;
|
||||||
while (idx < cnt)
|
while (idx < cnt)
|
||||||
{
|
{
|
||||||
NSString *lang = [languages objectAtIndex: idx];
|
NSString *lang = [languages objectAtIndex: idx];
|
||||||
[mArray addObject: [self canonicalLanguageIdentifierFromString: lang]];
|
if (![mArray containsObject: lang])
|
||||||
|
[mArray addObject: [self canonicalLanguageIdentifierFromString: lang]];
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,7 +733,8 @@ static NSRecursiveLock *classLock = nil;
|
||||||
|
|
||||||
if ([key isEqualToString: NSLocaleUsesMetricSystem])
|
if ([key isEqualToString: NSLocaleUsesMetricSystem])
|
||||||
{
|
{
|
||||||
NSString *mSys = [self _getMeasurementSystem];
|
NSString *mSys = [_components objectForKey: key];
|
||||||
|
mSys = (mSys == nil) ? [self _getMeasurementSystem] : mSys;
|
||||||
if (mSys != nil)
|
if (mSys != nil)
|
||||||
{
|
{
|
||||||
[_components setValue: mSys forKey: NSLocaleMeasurementSystem];
|
[_components setValue: mSys forKey: NSLocaleMeasurementSystem];
|
||||||
|
@ -856,6 +858,7 @@ static NSRecursiveLock *classLock = nil;
|
||||||
else
|
else
|
||||||
result = @"U.S.";
|
result = @"U.S.";
|
||||||
}
|
}
|
||||||
|
ulocdata_close (localeDate);
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -917,6 +920,7 @@ static NSRecursiveLock *classLock = nil;
|
||||||
// FIXME: The icu docs are a bit iffy and don't explain what len == 1
|
// FIXME: The icu docs are a bit iffy and don't explain what len == 1
|
||||||
// means. So, if it is encountered, we simply skip it.
|
// means. So, if it is encountered, we simply skip it.
|
||||||
}
|
}
|
||||||
|
uset_close (charSet);
|
||||||
|
|
||||||
result = [mSet copyWithZone: NULL];
|
result = [mSet copyWithZone: NULL];
|
||||||
RELEASE(mSet);
|
RELEASE(mSet);
|
||||||
|
@ -938,6 +942,7 @@ static NSRecursiveLock *classLock = nil;
|
||||||
cLocaleId = [_localeId UTF8String];
|
cLocaleId = [_localeId UTF8String];
|
||||||
localeData = ulocdata_open (cLocaleId, &err);
|
localeData = ulocdata_open (cLocaleId, &err);
|
||||||
strLen = ulocdata_getDelimiter (localeData, delimiterType, result, 32, &err);
|
strLen = ulocdata_getDelimiter (localeData, delimiterType, result, 32, &err);
|
||||||
|
ulocdata_close (localeData);
|
||||||
if (U_SUCCESS(err))
|
if (U_SUCCESS(err))
|
||||||
return [NSString stringWithCharacters: (unichar *)result length: strLen];
|
return [NSString stringWithCharacters: (unichar *)result length: strLen];
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue