Maybe fix mutation of IEnumerable (`InvalidOperationException`)
fixes 3024bc0d0
This commit is contained in:
parent
f0529fde28
commit
7a26546cfc
|
@ -186,7 +186,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var lf in RegisteredFunctions.Where(l => l.Event == "OnSavestateSave"))
|
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == "OnSavestateSave").ToList())
|
||||||
{
|
{
|
||||||
lf.Call(name);
|
lf.Call(name);
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var lf in RegisteredFunctions.Where(l => l.Event == "OnSavestateLoad"))
|
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == "OnSavestateLoad").ToList())
|
||||||
{
|
{
|
||||||
lf.Call(name);
|
lf.Call(name);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (IsUpdateSupressed) return;
|
if (IsUpdateSupressed) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var lf in RegisteredFunctions.Where(l => l.Event == "OnFrameStart"))
|
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == "OnFrameStart").ToList())
|
||||||
{
|
{
|
||||||
lf.Call();
|
lf.Call();
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (IsUpdateSupressed) return;
|
if (IsUpdateSupressed) return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var lf in RegisteredFunctions.Where(l => l.Event == "OnFrameEnd"))
|
foreach (var lf in RegisteredFunctions.Where(static l => l.Event == "OnFrameEnd").ToList())
|
||||||
{
|
{
|
||||||
lf.Call();
|
lf.Call();
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public void CallExitEvent(LuaFile lf)
|
public void CallExitEvent(LuaFile lf)
|
||||||
{
|
{
|
||||||
foreach (var exitCallback in RegisteredFunctions
|
foreach (var exitCallback in RegisteredFunctions
|
||||||
.Where(l => l.Event == "OnExit" && (l.LuaFile.Path == lf.Path || l.LuaFile.Thread == lf.Thread)))
|
.Where(l => l.Event == "OnExit" && (l.LuaFile.Path == lf.Path || l.LuaFile.Thread == lf.Thread))
|
||||||
|
.ToList())
|
||||||
{
|
{
|
||||||
exitCallback.Call();
|
exitCallback.Call();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue