diff --git a/Source/Engine/UI/GUI/ContainerControl.cs b/Source/Engine/UI/GUI/ContainerControl.cs index 32b03af0d..017b8ee5c 100644 --- a/Source/Engine/UI/GUI/ContainerControl.cs +++ b/Source/Engine/UI/GUI/ContainerControl.cs @@ -173,7 +173,7 @@ namespace FlaxEngine.GUI // Delete children while (_children.Count > 0) { - _children[0].Dispose(); + _children[^1].Dispose(); } _isLayoutLocked = wasLayoutLocked;