mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 17:12:40 +01:00
DroidFish: Fixed NPE when shutting down program while trying to contact a network engine.
This commit is contained in:
@@ -244,8 +244,10 @@ public class NetworkEngine extends UCIEngineBase {
|
|||||||
isRunning = false;
|
isRunning = false;
|
||||||
if (startupThread != null)
|
if (startupThread != null)
|
||||||
startupThread.interrupt();
|
startupThread.interrupt();
|
||||||
try { socket.getOutputStream().write("quit\n".getBytes()); } catch (IOException e) {}
|
if (socket != null) {
|
||||||
try { socket.close(); } catch (IOException e) {}
|
try { socket.getOutputStream().write("quit\n".getBytes()); } catch (IOException e) {}
|
||||||
|
try { socket.close(); } catch (IOException e) {}
|
||||||
|
}
|
||||||
super.shutDown();
|
super.shutDown();
|
||||||
if (stdOutThread != null)
|
if (stdOutThread != null)
|
||||||
stdOutThread.interrupt();
|
stdOutThread.interrupt();
|
||||||
|
|||||||
Reference in New Issue
Block a user