mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-05 20:52:48 +00:00
ASTextNode should avoid acquiring its lock multiple times #trivial (#820)
Since the lock was acquire before we try to access the renderer, we should call `-_locked_renderer` to avoid re-acquiring the same (recursive) lock.
This commit is contained in:
@@ -769,7 +769,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
|
||||
if (highlightTargetLayer != nil) {
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
ASTextKitRenderer *renderer = [self _renderer];
|
||||
ASTextKitRenderer *renderer = [self _locked_renderer];
|
||||
|
||||
NSArray *highlightRects = [renderer rectsForTextRange:highlightRange measureOption:ASTextKitRendererMeasureOptionBlock];
|
||||
NSMutableArray *converted = [NSMutableArray arrayWithCapacity:highlightRects.count];
|
||||
|
||||
Reference in New Issue
Block a user