Skip to content

Commit

Permalink
Refactor ToolManager.Close
Browse files Browse the repository at this point in the history
that ought to cover everything
  • Loading branch information
YoshiRulz committed Jul 15, 2024
1 parent f9cdad2 commit f742fe5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/BizHawk.Client.EmuHawk/tools/ToolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,19 @@ public void Close(Type toolType)

public void Close()
{
_tools.ForEach(t => t.Close());
var toolsCopy = _tools.ToArray();
_tools.Clear();
foreach (var t in toolsCopy)
{
try
{
t.Close();
}
catch (Exception e)
{
Console.WriteLine($"caught while calling Form.Close on tool: {e}");
}
}
}

/// <summary>
Expand Down

0 comments on commit f742fe5

Please sign in to comment.