From 97ae32c619c6707e74a55d55c7d64e305b57512a Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 14 May 2020 15:14:18 -0300 Subject: [PATCH] fix collection modified exception. --- src/Avalonia.Controls/Window.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index 1159fc4928..086615d7d9 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -399,7 +399,7 @@ namespace Avalonia.Controls { bool canClose = true; - foreach(var child in _children) + foreach(var child in _children.ToList()) { if(!child.HandleClosing()) {