From: Keith Packard Date: Mon, 22 Nov 2010 23:53:27 +0000 (-0800) Subject: altosui: Close serial port when debug link fails X-Git-Tag: debian/0.7.1+168+gcb08bc2~15^2~20 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=68323cbb222f1f33198a42abaa0550af22f75a93 altosui: Close serial port when debug link fails If the debug connection isn't working, close down the serial port when reporting the failure. Signed-off-by: Keith Packard --- diff --git a/ao-tools/altosui/AltosFlash.java b/ao-tools/altosui/AltosFlash.java index fa2465d3..3af25c23 100644 --- a/ao-tools/altosui/AltosFlash.java +++ b/ao-tools/altosui/AltosFlash.java @@ -336,7 +336,9 @@ public class AltosFlash { debug = new AltosDebug(in_debug_dongle); input = new FileInputStream(file); image = new AltosHexfile(input); - if (!debug.check_connection()) + if (!debug.check_connection()) { + debug.close(); throw new IOException("Debug port not connected"); + } } } \ No newline at end of file