mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
on ASDataController dealloc, ensure that loaded Cell nodes are not in the TableViewCell. For reasons I don't fully understand, this avoids a retain cycle with the currently displayed cells.
This commit is contained in:
@@ -508,4 +508,17 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
||||
return ASFindElementsInMultidimensionalArrayAtIndexPaths(_nodes, [indexPaths sortedArrayUsingSelector:@selector(compare:)]);
|
||||
}
|
||||
|
||||
#pragma mark - Dealloc
|
||||
|
||||
- (void)dealloc {
|
||||
ASDisplayNodeAssertMainThread();
|
||||
[_nodes enumerateObjectsUsingBlock:^(NSMutableArray *section, NSUInteger sectionIndex, BOOL *stop) {
|
||||
[section enumerateObjectsUsingBlock:^(ASCellNode *node, NSUInteger rowIndex, BOOL *stop) {
|
||||
if (node.isNodeLoaded && node.view.superview) {
|
||||
[node.view removeFromSuperview];
|
||||
}
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user