diff --git a/src/Lynx/Model/Game.cs b/src/Lynx/Model/Game.cs index 004d239b1..7e4e8c645 100644 --- a/src/Lynx/Model/Game.cs +++ b/src/Lynx/Model/Game.cs @@ -261,7 +261,7 @@ public void UpdateInitialPosition() public void FreeResources() { - ArrayPool.Shared.Return(_gameStack); + ArrayPool.Shared.Return(_gameStack, clearArray: true); ArrayPool.Shared.Return(_positionHashHistory); CurrentPosition.FreeResources(); diff --git a/src/Lynx/Searcher.cs b/src/Lynx/Searcher.cs index 444df0d99..01b63007a 100644 --- a/src/Lynx/Searcher.cs +++ b/src/Lynx/Searcher.cs @@ -19,8 +19,9 @@ public Searcher(ChannelReader uciReader, ChannelWriter engineWri _engineWriter = engineWriter; _tt = new TranspositionTable(); - _logger = LogManager.GetCurrentClassLogger(); Engine = new Engine(_engineWriter, _tt); + + _logger = LogManager.GetCurrentClassLogger(); } public Engine Engine { get; } @@ -57,7 +58,6 @@ public async Task Run(CancellationToken cancellationToken) private void OnGoCommand(GoCommand goCommand) { var searchConstraints = TimeManager.CalculateTimeManagement(Engine.Game, goCommand); - var searchResult = Engine.Search(goCommand, searchConstraints); if (searchResult is not null) diff --git a/tests/Lynx.Generator.Test/Lynx.Generator.Test.csproj b/tests/Lynx.Generator.Test/Lynx.Generator.Test.csproj index d8bf4db80..42841f9f2 100644 --- a/tests/Lynx.Generator.Test/Lynx.Generator.Test.csproj +++ b/tests/Lynx.Generator.Test/Lynx.Generator.Test.csproj @@ -15,7 +15,7 @@ - + diff --git a/tests/Lynx.Test/Lynx.Test.csproj b/tests/Lynx.Test/Lynx.Test.csproj index 9232b8c66..94ca2e719 100644 --- a/tests/Lynx.Test/Lynx.Test.csproj +++ b/tests/Lynx.Test/Lynx.Test.csproj @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - +