fix bug resetting defaults

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32515 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-09 11:12:30 +00:00
parent b918c226f7
commit 99d5283104
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-03-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: Fix bug in resetting ... was ending up
with an immutable dictionary for the registration domain.
2011-03-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSAttributedString.m: remove unused assignment

View file

@ -391,9 +391,18 @@ newLanguages(NSArray *oldNames)
[classLock lock];
NS_DURING
{
regDefs = [sharedDefaults volatileDomainForName: @"NSRegistrationDomain"];
if (nil != sharedDefaults)
if (nil == sharedDefaults)
{
regDefs = nil;
}
else
{
/* Extract the registration domain from the old defaults.
*/
regDefs = [[[sharedDefaults->_tempDomains
objectForKey: NSRegistrationDomain] retain] autorelease];
[sharedDefaults->_tempDomains
removeObjectForKey: NSRegistrationDomain];
/* To ensure that we don't try to synchronise the old defaults to disk
* after creating the new ones, remove as housekeeping notification