mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Minor thread safety fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25774 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2ef54f7ef2
commit
ab9404b6a3
3 changed files with 18 additions and 5 deletions
|
@ -266,14 +266,20 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
|
|||
{
|
||||
NSDictionary *regDefs;
|
||||
|
||||
[sharedDefaults synchronize]; // Ensure changes are written.
|
||||
regDefs = RETAIN([sharedDefaults->_tempDomains
|
||||
objectForKey: NSRegistrationDomain]);
|
||||
/* To ensure that we don't try to synchronise the old defaults to disk
|
||||
* after creating the new ones, remove as housekeeping notification
|
||||
* observer.
|
||||
*/
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: sharedDefaults];
|
||||
|
||||
/* Ensure changes are written, and no changes left so we can't end up
|
||||
* writing old changes to the new defaults.
|
||||
*/
|
||||
[sharedDefaults synchronize];
|
||||
DESTROY(sharedDefaults->_changedDomains);
|
||||
|
||||
regDefs = RETAIN([sharedDefaults->_tempDomains
|
||||
objectForKey: NSRegistrationDomain]);
|
||||
setSharedDefaults = NO;
|
||||
DESTROY(sharedDefaults);
|
||||
if (regDefs != nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue