diff --git a/ChangeLog b/ChangeLog index b0d72f759..ec779f83d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-03-09 Richard Frith-Macdonald + + * Source/NSUserDefaults.m: Fix bug in resetting ... was ending up + with an immutable dictionary for the registration domain. + 2011-03-08 Richard Frith-Macdonald * Source/GSAttributedString.m: remove unused assignment diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index b280c56dd..895f323fa 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -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