[Sandbox Broker] Synchronize full access operation

Full access should be synchronized, otherwise rapid access to the same
path from different threads will cause crashes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
lastfm
Christopher Snowhill 2022-06-27 01:00:11 -07:00
parent dc02404184
commit 9411e7bd45
1 changed files with 9 additions and 9 deletions

View File

@ -266,18 +266,18 @@ static SandboxBroker *kSharedSandboxBroker = nil;
if(!_entry) {
_entry = [self recursivePathTest:folderUrl];
}
}
if(_entry) {
[storage addObject:_entry];
if(_entry) {
[storage addObject:_entry];
if(_entry.secureUrl) {
[_entry.secureUrl startAccessingSecurityScopedResource];
if(_entry.secureUrl) {
[_entry.secureUrl startAccessingSecurityScopedResource];
}
return CFBridgingRetain(_entry);
} else {
return NULL;
}
return CFBridgingRetain(_entry);
} else {
return NULL;
}
}