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:
Ethan Nagel
2015-04-22 13:57:25 -07:00
parent 1316389f10
commit b40c1dbfc3

View File

@@ -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