X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosSerial.java;h=efa63f681819e2ed9f3d22ebfac66d79e47f7750;hb=22800dc094797e1e0ad99124198809d0360f7556;hp=f12b31b3187e9b253b4a3560080db9d8e2966d7e;hpb=71da54a5ce255395376a44586782ab8b6f3b289f;p=fw%2Faltos diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index f12b31b3..efa63f68 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -104,10 +104,8 @@ public class AltosSerial implements Runnable { } public void close() { - if (altos != null) { + if (altos != null) libaltos.altos_close(altos); - altos = null; - } if (input_thread != null) { try { input_thread.interrupt(); @@ -116,6 +114,10 @@ public class AltosSerial implements Runnable { } input_thread = null; } + if (altos != null) { + libaltos.altos_free(altos); + altos = null; + } } public void putc(char c) { @@ -139,7 +141,7 @@ public class AltosSerial implements Runnable { throw new FileNotFoundException(device.getPath()); input_thread = new Thread(this); input_thread.start(); - print("\nE 0\nm 1\n"); + print("\nE 0\n"); try { Thread.sleep(200); } catch (InterruptedException e) {