Ensure LuaValues are disposed.
Adding in these missing calls prevents these instances from having to be finalized.
This commit is contained in:
@@ -28,12 +28,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Returns a table of players filtered by the specified function.")]
|
||||
public Player[] GetPlayers(LuaFunction filter)
|
||||
{
|
||||
return Context.World.Players
|
||||
.Where(p =>
|
||||
{
|
||||
using (var f = filter.Call(p.ToLuaValue(Context)))
|
||||
return f.First().ToBoolean();
|
||||
}).ToArray();
|
||||
return FilteredObjects(Context.World.Players, filter).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user