added safeguards in stopFlowControlThread methods

pull/69/head
Felipe Herranz 2016-07-23 13:21:30 +02:00
rodzic 16966f1bd8
commit 19f7773dff
2 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -589,8 +589,11 @@ public class CH34xSerialDevice extends UsbSerialDevice
private void stopFlowControlThread()
{
flowControlThread.stopThread();
flowControlThread = null;
if(flowControlThread != null)
{
flowControlThread.stopThread();
flowControlThread = null;
}
}
private class FlowControlThread extends Thread

Wyświetl plik

@ -566,8 +566,11 @@ public class CP2102SerialDevice extends UsbSerialDevice
private void stopFlowControlThread()
{
flowControlThread.stopThread();
flowControlThread = null;
if(flowControlThread != null)
{
flowControlThread.stopThread();
flowControlThread = null;
}
}
private int setControlCommand(int request, int value, byte[] data)