mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Move clearing out of ASTextKitComponents property delegates into ASTextKitComponents dealloc (#591)
This commit is contained in:
committed by
GitHub
parent
5186a4317e
commit
5c6cd7c8d9
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ASTextKitComponents.m
|
||||
// ASTextKitComponents.mm
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
@implementation ASTextKitComponents
|
||||
|
||||
#pragma mark - Class
|
||||
|
||||
+ (instancetype)componentsWithAttributedSeedString:(NSAttributedString *)attributedSeedString
|
||||
textContainerSize:(CGSize)textContainerSize
|
||||
{
|
||||
@@ -58,6 +60,17 @@
|
||||
return components;
|
||||
}
|
||||
|
||||
#pragma mark - Lifecycle
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
// Nil out all delegate to prevent crash
|
||||
_textView.delegate = nil;
|
||||
_layoutManager.delegate = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Sizing
|
||||
|
||||
- (CGSize)sizeForConstrainedWidth:(CGFloat)constrainedWidth
|
||||
{
|
||||
ASTextKitComponents *components = self;
|
||||
|
||||
Reference in New Issue
Block a user