From 68323cbb222f1f33198a42abaa0550af22f75a93 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Nov 2010 15:53:27 -0800 Subject: [PATCH] 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 --- ao-tools/altosui/AltosFlash.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.30.2