Refactor `ToolManager.Close`

that ought to cover everything
This commit is contained in:
YoshiRulz 2024-07-16 04:09:01 +10:00
parent f9cdad2ea6
commit f742fe55d5
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 12 additions and 1 deletions

View File

@ -662,8 +662,19 @@ namespace BizHawk.Client.EmuHawk
public void Close() public void Close()
{ {
_tools.ForEach(t => t.Close()); var toolsCopy = _tools.ToArray();
_tools.Clear(); _tools.Clear();
foreach (var t in toolsCopy)
{
try
{
t.Close();
}
catch (Exception e)
{
Console.WriteLine($"caught while calling Form.Close on tool: {e}");
}
}
} }
/// <summary> /// <summary>