thanks!my mistake. It works now!
There is another problem. If all resources are released every time when closeAI() is called, it must be reloaded when initAI() is called. But the initialization of chess engine takes a long time. Whether the resetAI() function can be provided to enable the engine to perform necessary reset operations without resources released.
In the case of existing interfaces, I try to implement only resetAI() operations in closeAI(), but I find that sometimes resources are not released.
My code is:
@Override
public void closeAI()
{
if(engineInited)
{
waitEngineReady(); // here if we release all the resources, we must load again in initAI()
}
}
There is another problem. If all resources are released every time when closeAI() is called, it must be reloaded when initAI() is called. But the initialization of chess engine takes a long time. Whether the resetAI() function can be provided to enable the engine to perform necessary reset operations without resources released.
In the case of existing interfaces, I try to implement only resetAI() operations in closeAI(), but I find that sometimes resources are not released.
My code is:
@Override
public void closeAI()
{
if(engineInited)
{
waitEngineReady(); // here if we release all the resources, we must load again in initAI()
}
}