Sometimes `ASPerformMainThreadDeallocation` does not work
cuihanxiu opened this issue · comments
cuihanxiu commented
My gesture is dealloated on sub thread
// ViewController
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
__block SubNode *node = [SubNode new];
node.aGestureRecognizer = [CustomGesture new];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSLog(@"+++%@, %@", node, NSThread.currentThread);
node = nil;
});
}
// SubNode
@interface SubNode : ASDisplayNode
@property (nonatomic, nullable) UIGestureRecognizer *aGestureRecognizer;
@end
// CustomGesture
@implementation CustomGesture
- (void)dealloc {
if (![NSThread isMainThread]) {
NSLog(@"+++ sub thread");
}
}
@end
appleguy commented
This should work correctly in the current code, which is all at texturegroup.org . This repo is deprecated.
…Sent from my iPhone
On Jun 17, 2020, at 5:06 AM, cuihanxiu ***@***.***> wrote:
My gesture is dealloated on sub thread
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
cuihanxiu commented
It's ok in Texture
, thank you.