Fix a Windows-only crash on exit without 'quit'
authorSami Kiminki <skiminki@users.noreply.github.com>
Thu, 14 May 2020 09:00:35 +0000 (12:00 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 14 May 2020 18:35:40 +0000 (20:35 +0200)
commitbeb327f910ed782f358d69201643ccd99b982a48
tree210291f7ccba6146a2588fd952bf3e60079a7801
parentcca643669db016f20c6e91f50892a0b44f297a48
Fix a Windows-only crash on exit without 'quit'

There was a bug in commit d4763424d2728fe2dfd0a6fe747666feb6a2fdbb
(Add support for Windows large pages) that could result in trying to
free memory allocated with VirtualAlloc incorrectly with free().

Fix this by reverting the TT.resize(0) logic in the previous commit,
and instead, just call aligned_ttmem_free() in
TranspositionTable::~TranspositionTable().

fixes https://github.com/official-stockfish/Stockfish/issues/2677

closes https://github.com/official-stockfish/Stockfish/pull/2679

No functional change
src/main.cpp
src/misc.cpp
src/misc.h
src/tt.cpp
src/tt.h