Hopefully fix crashing issues
This commit is contained in:
parent
fe7e64e9c3
commit
fe453aa3fd
|
@ -65,6 +65,9 @@ type
|
||||||
mailbox*: array[Square(0)..Square(63), Piece]
|
mailbox*: array[Square(0)..Square(63), Piece]
|
||||||
|
|
||||||
|
|
||||||
|
proc toFEN*(self: Position): string
|
||||||
|
|
||||||
|
|
||||||
func inCheck*(self: Position): bool {.inline.} =
|
func inCheck*(self: Position): bool {.inline.} =
|
||||||
## Returns if the current side to move is in check
|
## Returns if the current side to move is in check
|
||||||
return self.checkers != 0
|
return self.checkers != 0
|
||||||
|
|
|
@ -357,8 +357,9 @@ proc startUCISession* =
|
||||||
of NewGame:
|
of NewGame:
|
||||||
session.board = newDefaultChessboard()
|
session.board = newDefaultChessboard()
|
||||||
of Go:
|
of Go:
|
||||||
var thread: Thread[tuple[session: UCISession, command: UCICommand]]
|
var thread = new Thread[tuple[session: UCISession, command: UCICommand]]
|
||||||
createThread(thread, bestMove, (session, cmd))
|
createThread(thread[], bestMove, (session, cmd))
|
||||||
|
GcRef(thread)
|
||||||
of Stop:
|
of Stop:
|
||||||
session.currentSearch.load().stop()
|
session.currentSearch.load().stop()
|
||||||
of SetOption:
|
of SetOption:
|
||||||
|
|
Loading…
Reference in New Issue