FLEX-35321 CAUSE: If a component is removed from stage during a validation cycle, the LayoutManager nevertheless sets its initialized flag to true, even if it's not on stage anymore. That's because it doesn't check at the end whether the component is still on stage.
SOLUTION: Now the LayoutManager verifies that the component is still on stage before initializing it. Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/9c5cbbe5 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/9c5cbbe5 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/9c5cbbe5 Branch: refs/heads/master Commit: 9c5cbbe553c9d8afe7982f3ba4bf178ee563bf35 Parents: 442b5f8 Author: Mihai Chira <mih...@apache.org> Authored: Sat Jun 10 13:36:47 2017 +0200 Committer: Mihai Chira <mih...@apache.org> Committed: Sat Jun 10 13:36:47 2017 +0200 ---------------------------------------------------------------------- .../framework/src/mx/managers/LayoutManager.as | 28 ++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9c5cbbe5/frameworks/projects/framework/src/mx/managers/LayoutManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/managers/LayoutManager.as b/frameworks/projects/framework/src/mx/managers/LayoutManager.as index feebeff..d070203 100644 --- a/frameworks/projects/framework/src/mx/managers/LayoutManager.as +++ b/frameworks/projects/framework/src/mx/managers/LayoutManager.as @@ -846,11 +846,14 @@ public class LayoutManager extends EventDispatcher implements ILayoutManager var obj:ILayoutManagerClient = ILayoutManagerClient(updateCompleteQueue.removeLargest()); while (obj) { - if (!obj.initialized && obj.processedDescriptors) - obj.initialized = true; - if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE)) - obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE)); - obj.updateCompletePendingFlag = false; + if(obj.nestLevel) + { + if (!obj.initialized && obj.processedDescriptors) + obj.initialized = true; + if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE)) + obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE)); + obj.updateCompletePendingFlag = false; + } obj = ILayoutManagerClient(updateCompleteQueue.removeLargest()); } @@ -1094,12 +1097,15 @@ public class LayoutManager extends EventDispatcher implements ILayoutManager obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target)); while (obj) { - if (!obj.initialized) - obj.initialized = true; - - if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE)) - obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE)); - obj.updateCompletePendingFlag = false; + if(obj.nestLevel) + { + if (!obj.initialized) + obj.initialized = true; + + if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE)) + obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE)); + obj.updateCompletePendingFlag = false; + } obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target)); } }