From b9888c072d82ca396b5df2178a4f6868a1356d82 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 8 Sep 2015 09:26:12 -0700 Subject: [PATCH] Avoid infinite loop in syncChildren(). This was a typo in #1062. Also, some minor code cleanup and expose (in the app dump) the _disqualifiedFromEverAppearingAgain boolean for debugging purposes. --- packages/flutter/lib/src/widgets/framework.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 1720c7848d6..8468d31238a 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -563,8 +563,7 @@ abstract class TagNode extends Widget { void _sync(Widget old, dynamic slot) { assert(!_debugChildTaken); - Widget oldChild = (old as TagNode)?.child; - child = syncChild(child, oldChild, slot); + child = syncChild(child, (old as TagNode)?.child, slot); if (child != null) { assert(child.parent == this); assert(child.renderObject != null); @@ -945,6 +944,12 @@ abstract class StatefulComponent extends Component { fn(); _scheduleBuild(); } + + String toStringName([String prefix = '', String startPrefix = '']) { + if (_disqualifiedFromEverAppearingAgain) + return '[[DISQUALIFIED]] ${super.toStringName()}'; + return super.toStringName(); + } } Set _dirtyComponents = new Set(); @@ -1228,8 +1233,8 @@ abstract class RenderObjectWrapper extends Widget { } else { syncChild(null, oldChild, null); } - oldChildrenBottom -= 1; - } + } // else the node was probably moved elsewhere, ignore it + oldChildrenBottom -= 1; } }