mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add 'submodules/AsyncDisplayKit/' from commit '02bedc12816e251ad71777f9d2578329b6d2bef6'
git-subtree-dir: submodules/AsyncDisplayKit git-subtree-mainline:d06f423e0egit-subtree-split:02bedc1281
This commit is contained in:
56
submodules/AsyncDisplayKit/Source/ASMainThreadDeallocation.h
Normal file
56
submodules/AsyncDisplayKit/Source/ASMainThreadDeallocation.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ASMainThreadDeallocation.h
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) Pinterest, Inc. All rights reserved.
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (ASMainThreadIvarTeardown)
|
||||
|
||||
/**
|
||||
* Call this from -dealloc to schedule this instance's
|
||||
* ivars for main thread deallocation as needed.
|
||||
*
|
||||
* This method includes a check for whether it's on the main thread,
|
||||
* and it will do nothing in that case.
|
||||
*/
|
||||
- (void)scheduleIvarsForMainThreadDeallocation;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (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 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.
|
||||
*/
|
||||
@property (class, readonly) BOOL needsMainThreadDeallocation;
|
||||
|
||||
@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
|
||||
Reference in New Issue
Block a user