mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-07 05:25:12 +00:00
Fix crash when call needsMainThreadDeallocation on NSProxy instances #trivial (#965)
This commit is contained in:
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* class need to be deallocated on the main thread.
|
||||
* You do not access this property yourself.
|
||||
*
|
||||
* The NSObject implementation returns NO if the class name has
|
||||
* The NSObject implementation returns YES if the class name has
|
||||
* a prefix UI, AV, or CA. This property is also overridden to
|
||||
* return fixed values for other common classes, such as UIImage,
|
||||
* UIGestureRecognizer, and UIResponder.
|
||||
@@ -43,5 +43,18 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@end
|
||||
|
||||
@interface NSProxy (ASNeedsMainThreadDeallocation)
|
||||
|
||||
/**
|
||||
* Override this property to indicate that instances of this
|
||||
* class need to be deallocated on the main thread.
|
||||
* You do not access this property yourself.
|
||||
*
|
||||
* The NSProxy implementation returns NO because
|
||||
* proxies almost always hold weak references.
|
||||
*/
|
||||
@property (class, readonly) BOOL needsMainThreadDeallocation;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -199,3 +199,12 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSProxy (ASNeedsMainThreadDeallocation)
|
||||
|
||||
+ (BOOL)needsMainThreadDeallocation
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user