mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Display an error message if an engine is terminated prematurely.
This commit is contained in:
@@ -408,6 +408,7 @@ you are not actively using the program.\
|
|||||||
<string name="stockfish_engine">Stockfish</string>
|
<string name="stockfish_engine">Stockfish</string>
|
||||||
<string name="cuckoochess_engine">CuckooChess</string>
|
<string name="cuckoochess_engine">CuckooChess</string>
|
||||||
<string name="failed_to_start_engine">Failed to start engine</string>
|
<string name="failed_to_start_engine">Failed to start engine</string>
|
||||||
|
<string name="engine_terminated">Engine terminated</string>
|
||||||
|
|
||||||
<string name="err_too_few_spaces">Too few spaces</string>
|
<string name="err_too_few_spaces">Too few spaces</string>
|
||||||
<string name="err_invalid_piece">Invalid piece</string>
|
<string name="err_invalid_piece">Invalid piece</string>
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class ExternalEngine extends UCIEngineBase {
|
|||||||
engineProc.waitFor();
|
engineProc.waitFor();
|
||||||
if (!startedOk)
|
if (!startedOk)
|
||||||
report.reportError(context.getString(R.string.failed_to_start_engine));
|
report.reportError(context.getString(R.string.failed_to_start_engine));
|
||||||
|
else {
|
||||||
|
report.reportError(context.getString(R.string.engine_terminated));
|
||||||
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,12 +187,12 @@ public class ExternalEngine extends UCIEngineBase {
|
|||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
@Override
|
@Override
|
||||||
public void shutDown() {
|
public void shutDown() {
|
||||||
|
if (exitThread != null)
|
||||||
|
exitThread.interrupt();
|
||||||
super.shutDown();
|
super.shutDown();
|
||||||
if (engineProc != null)
|
if (engineProc != null)
|
||||||
engineProc.destroy();
|
engineProc.destroy();
|
||||||
engineProc = null;
|
engineProc = null;
|
||||||
if (exitThread != null)
|
|
||||||
exitThread.interrupt();
|
|
||||||
if (stdInThread != null)
|
if (stdInThread != null)
|
||||||
stdInThread.interrupt();
|
stdInThread.interrupt();
|
||||||
if (stdErrThread != null)
|
if (stdErrThread != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user