diff --git a/Dalamud/Interface/Windowing/WindowSystem.cs b/Dalamud/Interface/Windowing/WindowSystem.cs index 0e3e2d5eb..b43194b22 100644 --- a/Dalamud/Interface/Windowing/WindowSystem.cs +++ b/Dalamud/Interface/Windowing/WindowSystem.cs @@ -106,7 +106,8 @@ namespace Dalamud.Interface.Windowing if (hasNamespace) ImGui.PushID(this.Namespace); - foreach (var window in this.windows) + // Shallow clone the list of windows so that we can edit it without modifying it while the loop is iterating + foreach (var window in this.windows.ToArray()) { #if DEBUG // Log.Verbose($"[WS{(hasNamespace ? "/" + this.Namespace : string.Empty)}] Drawing {window.WindowName}");