mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-20 13:19:16 +00:00
Avoid triggering main thread assertions in collection/table dealloc #trivial (#803)
* Avoid triggering main thread assertions in ASCollectionNode/ASTableNode dealloc * Put it back
This commit is contained in:
parent
e2478fc799
commit
8b431733d3
@ -172,12 +172,17 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
#if ASDISPLAYNODE_ASSERTIONS_ENABLED
|
||||
- (void)dealloc
|
||||
{
|
||||
if ([self isNodeLoaded]) {
|
||||
ASDisplayNodeAssert(self.view.superview == nil, @"Node's view should be removed from hierarchy.");
|
||||
if (self.nodeLoaded) {
|
||||
__weak UIView *view = self.view;
|
||||
ASPerformBlockOnMainThread(^{
|
||||
ASDisplayNodeCAssertNil(view.superview, @"Node's view should be removed from hierarchy.");
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark ASDisplayNode
|
||||
|
||||
|
||||
@ -104,12 +104,17 @@
|
||||
return [self initWithStyle:UITableViewStylePlain];
|
||||
}
|
||||
|
||||
#if ASDISPLAYNODE_ASSERTIONS_ENABLED
|
||||
- (void)dealloc
|
||||
{
|
||||
if ([self isNodeLoaded]) {
|
||||
ASDisplayNodeAssert(self.view.superview == nil, @"Node's view should be removed from hierarchy.");
|
||||
if (self.nodeLoaded) {
|
||||
__weak UIView *view = self.view;
|
||||
ASPerformBlockOnMainThread(^{
|
||||
ASDisplayNodeCAssertNil(view.superview, @"Node's view should be removed from hierarchy.");
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark ASDisplayNode
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user