Ensure the reliability layer is stopped when the modem is stopped.

This commit is contained in:
akwizgran
2012-12-07 15:03:54 +00:00
parent 9528a8b6d6
commit c4bf931b80

View File

@@ -92,8 +92,12 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
}
public void stop() throws IOException {
if(offHook.tryAcquire()) offHook.release();
else hangUp();
if(offHook.tryAcquire()) {
reliabilityLayer.stop();
offHook.release();
} else {
hangUp();
}
try {
port.closePort();
} catch(SerialPortException e) {