mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-23 17:09:17 +01:00
Merge pull request #1084 from wolfcomp/master
This commit is contained in:
commit
91ac86a12a
1 changed files with 13 additions and 1 deletions
|
|
@ -81,13 +81,25 @@ public class WindowSystem
|
||||||
if (!this.windows.Contains(window))
|
if (!this.windows.Contains(window))
|
||||||
throw new ArgumentException("This window is not registered on this WindowSystem.");
|
throw new ArgumentException("This window is not registered on this WindowSystem.");
|
||||||
|
|
||||||
|
if (window is IDisposable disposable)
|
||||||
|
disposable.Dispose();
|
||||||
|
|
||||||
this.windows.Remove(window);
|
this.windows.Remove(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove all windows from this <see cref="WindowSystem"/>.
|
/// Remove all windows from this <see cref="WindowSystem"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RemoveAllWindows() => this.windows.Clear();
|
public void RemoveAllWindows()
|
||||||
|
{
|
||||||
|
foreach (var window in this.windows)
|
||||||
|
{
|
||||||
|
if (window is IDisposable disposable)
|
||||||
|
disposable.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.windows.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a window by name.
|
/// Get a window by name.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue