mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-15 16:36:36 +00:00
Better error message if a display node is created in layoutSpecThatFits: and deallocated before it was added to a subnode
This commit is contained in:
parent
b075aa2851
commit
66acd69e22
@ -233,7 +233,7 @@ static inline std::vector<NSUInteger> findNodesInLayoutAtIndexesWithFilteredNode
|
|||||||
if (idx > lastIndex) { break; }
|
if (idx > lastIndex) { break; }
|
||||||
if (idx >= firstIndex && [indexes containsIndex:idx]) {
|
if (idx >= firstIndex && [indexes containsIndex:idx]) {
|
||||||
ASDisplayNode *node = (ASDisplayNode *)sublayout.layoutElement;
|
ASDisplayNode *node = (ASDisplayNode *)sublayout.layoutElement;
|
||||||
ASDisplayNodeCAssert(node, @"A flattened layout must consist exclusively of node sublayouts");
|
ASDisplayNodeCAssert(node, @"ASDisplayNode was deallocated before it was added to a subnode. It's likely the case that you use automatically manages subnodes and allocate a ASDisplayNode in layoutSpecThatFits: and don't have any strong reference to it.");
|
||||||
// Ignore the odd case in which a non-node sublayout is accessed and the type cast fails
|
// Ignore the odd case in which a non-node sublayout is accessed and the type cast fails
|
||||||
if (node != nil) {
|
if (node != nil) {
|
||||||
BOOL notFiltered = (filteredNodes == nil || [filteredNodes indexOfObjectIdenticalTo:node] == NSNotFound);
|
BOOL notFiltered = (filteredNodes == nil || [filteredNodes indexOfObjectIdenticalTo:node] == NSNotFound);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user