mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
fix: allow window list edits at any time
Slightly tweak the logic of the WindowSystem Draw() to make a shallow copy of the window list before iterating over it. This allows for the list to be edited at any time, but has a trade-off that modifications to the list won't take effect until the next frame, which is negligible and would have been the case anyways. This change does not break any existing APIs, and should incur minimal (if any) performance penalty.
This commit is contained in:
parent
dbbcc0f287
commit
40e6289321
1 changed files with 2 additions and 1 deletions
|
|
@ -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}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue