mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Remove CALayer and UIView implementations of "name" property.
This avoids CoreAnimation from capturing the name from a background thread deep within the internals of AVPlayerLayer, which commits transactions off the main thread. If the main thread is also accessing properties that require the lock, in very specific app architectures relying on AVPlayerLayer, this can cause a deadlock. The "name" property is primarily used by ASDK's unit test infrastructure, so I'm leaving it in place for that purpose - and it may still be used for debugging, if someone wants to set it. It will remain possible to get the node from a layer or view with asyncdisplaykit_node, and access name from there.
This commit is contained in:
@@ -36,11 +36,11 @@ static CALayer *layerWithName(NSString *name) {
|
||||
}
|
||||
|
||||
static NSString *orderStringFromSublayers(CALayer *l) {
|
||||
return [[l.sublayers valueForKey:@"name"] componentsJoinedByString:@","];
|
||||
return [[[l.sublayers valueForKey:@"asyncdisplaykit_node"] valueForKey:@"name"] componentsJoinedByString:@","];
|
||||
}
|
||||
|
||||
static NSString *orderStringFromSubviews(UIView *v) {
|
||||
return [[v.subviews valueForKey:@"name"] componentsJoinedByString:@","];
|
||||
return [[[v.subviews valueForKey:@"asyncdisplaykit_node"] valueForKey:@"name"] componentsJoinedByString:@","];
|
||||
}
|
||||
|
||||
static NSString *orderStringFromSubnodes(ASDisplayNode *n) {
|
||||
|
||||
Reference in New Issue
Block a user