git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27645 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-01-21 06:39:39 +00:00
parent c1aae0c84c
commit 86c18013e5
3 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2009-01-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: ([setObject:forKey:]) copy the object
rather than just retaining it. Fixes bug #23570
2009-01-20 Richard Frith-Macdonald <rfm@gnu.org>
* Documentation/manual/ExceptionHandling.texi: Fix error in

View file

@ -384,10 +384,11 @@ GS_EXPORT NSString* const GSLocale;
- (void) setInteger: (int)value forKey: (NSString*)defaultName;
/**
* Sets an object value for defaultName in the application domain.<br />
* Sets a copy of an object value for defaultName in the
* application domain.<br />
* The defaultName must be a non-empty string.<br />
* The value must be an instance of one of the [NSString-propertyList]
* classes.<br />
* The value to be copied into the domain must be an instance
* of one of the [NSString-propertyList] classes.<br />
* <p>Causes a NSUserDefaultsDidChangeNotification to be posted
* if this is the first change to a persistent-domain since the
* last -synchronize.

View file

@ -1158,6 +1158,7 @@ static BOOL isPlistObject(id o)
value, defaultName];
}
value = [value copy];
[_lock lock];
obj = [_persDomains objectForKey: processName];
if ([obj isKindOfClass: NSMutableDictionaryClass] == YES)
@ -1173,6 +1174,7 @@ static BOOL isPlistObject(id o)
[dict setObject: value forKey: defaultName];
[self __changePersistentDomain: processName];
[_lock unlock];
RELEASE(value);
}
- (void) setValue: (id)value forKey: (NSString*)defaultName