kopia lustrzana https://github.com/felHR85/UsbSerial
added safeguards in stopFlowControlThread methods
rodzic
16966f1bd8
commit
19f7773dff
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue