mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Attept fix for deadlock
This commit is contained in:
parent
f071a8c7d0
commit
cd2626e26b
2 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2024-02-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSUserDefaults.m: Move posting of notification outside lock
|
||||
protected region to avoid deadlock.
|
||||
|
||||
2024-02-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSData.m: fix for #361
|
||||
|
|
|
@ -1923,7 +1923,7 @@ static BOOL isPlistObject(id o)
|
|||
[self _changePersistentDomain: NSGlobalDomain];
|
||||
}
|
||||
[_lock unlock];
|
||||
if (YES == haveChange)
|
||||
if (haveChange)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSUserDefaultsDidChangeNotification
|
||||
|
@ -2305,6 +2305,8 @@ NSDictionary *GSPrivateDefaultLocale()
|
|||
|
||||
- (void) _changePersistentDomain: (NSString*)domainName
|
||||
{
|
||||
BOOL haveChange = NO;
|
||||
|
||||
NSAssert(nil != domainName, NSInvalidArgumentException);
|
||||
[_lock lock];
|
||||
NS_DURING
|
||||
|
@ -2323,9 +2325,7 @@ NSDictionary *GSPrivateDefaultLocale()
|
|||
{
|
||||
updateCache(self);
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSUserDefaultsDidChangeNotification
|
||||
object: self];
|
||||
haveChange = YES;
|
||||
[_lock unlock];
|
||||
}
|
||||
NS_HANDLER
|
||||
|
@ -2334,6 +2334,12 @@ NSDictionary *GSPrivateDefaultLocale()
|
|||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
if (haveChange)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSUserDefaultsDidChangeNotification
|
||||
object: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*) _directory
|
||||
|
|
Loading…
Reference in a new issue