mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 16:29:55 +00:00
#trivial Shouldn't hold the lock while adding subnodes (#1091)
* Shouldn't hold the lock while adding subnodes * Add comments, good call @nguyenhuy
This commit is contained in:
parent
b556b2f775
commit
1fe241df91
@ -295,7 +295,9 @@ CGRect _ASControlNodeGetExpandedBounds(ASControlNode *controlNode);
|
|||||||
|
|
||||||
// only show tap-able areas for views with 1 or more addTarget:action: pairs
|
// only show tap-able areas for views with 1 or more addTarget:action: pairs
|
||||||
if ([ASControlNode enableHitTestDebug] && _debugHighlightOverlay == nil) {
|
if ([ASControlNode enableHitTestDebug] && _debugHighlightOverlay == nil) {
|
||||||
ASPerformBlockOnMainThread(^{
|
// do not use ASPerformBlockOnMainThread here, if it performs the block synchronously it will continue
|
||||||
|
// holding the lock while calling addSubnode.
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
// add a highlight overlay node with area of ASControlNode + UIEdgeInsets
|
// add a highlight overlay node with area of ASControlNode + UIEdgeInsets
|
||||||
self.clipsToBounds = NO;
|
self.clipsToBounds = NO;
|
||||||
_debugHighlightOverlay = [[ASImageNode alloc] init];
|
_debugHighlightOverlay = [[ASImageNode alloc] init];
|
||||||
|
|||||||
@ -251,6 +251,8 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
|||||||
|
|
||||||
// For debugging purposes we don't care about locking for now
|
// For debugging purposes we don't care about locking for now
|
||||||
if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) {
|
if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) {
|
||||||
|
// do not use ASPerformBlockOnMainThread here, if it performs the block synchronously it will continue
|
||||||
|
// holding the lock while calling addSubnode.
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
_debugLabelNode = [[ASTextNode alloc] init];
|
_debugLabelNode = [[ASTextNode alloc] init];
|
||||||
_debugLabelNode.layerBacked = YES;
|
_debugLabelNode.layerBacked = YES;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user