Also protect against mutation of `IEnumerable` for `onconsoleclose`

see 7a26546cf, fixes dc66b4357
This commit is contained in:
YoshiRulz 2022-09-29 08:51:14 +10:00
parent 7a26546cfc
commit 9815b377d1
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 1 deletions

View File

@ -266,7 +266,8 @@ namespace BizHawk.Client.EmuHawk
public void Close()
{
foreach (var closeCallback in RegisteredFunctions
.Where(l => l.Event == "OnConsoleClose"))
.Where(static l => l.Event == "OnConsoleClose")
.ToList())
{
closeCallback.Call();
}