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 { public void stop() throws IOException {
if(offHook.tryAcquire()) offHook.release(); if(offHook.tryAcquire()) {
else hangUp(); reliabilityLayer.stop();
offHook.release();
} else {
hangUp();
}
try { try {
port.closePort(); port.closePort();
} catch(SerialPortException e) { } catch(SerialPortException e) {