altosui: Clear displayed data rows as needed.
[fw/altos] / ao-tools / altosui / AltosSerial.java
index f12b31b3187e9b253b4a3560080db9d8e2966d7e..efa63f681819e2ed9f3d22ebfac66d79e47f7750 100644 (file)
@@ -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) {