summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-14 14:38:00 -0700
committerKeith Packard <keithp@keithp.com>2014-06-14 14:38:00 -0700
commit19273a4a341342ca6b5d65cfc490d92cbf23356f (patch)
treef1584cb8847ddae6f8f357a0752b5c976b328de5
parent2903f0911e79e381c6125022bb84096321c258eb (diff)
altosuilib: Make sure only one thread is closing serial device
Multiple closers can cause a crash by freeing the libaltos device twice Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosuilib/AltosSerial.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/altosuilib/AltosSerial.java b/altosuilib/AltosSerial.java
index 0632ca70..60e15bdb 100644
--- a/altosuilib/AltosSerial.java
+++ b/altosuilib/AltosSerial.java
@@ -117,7 +117,7 @@ public class AltosSerial extends AltosLink {
SwingUtilities.invokeLater(r);
}
- private void close_serial() {
+ private synchronized void close_serial() {
synchronized (devices_opened) {
devices_opened.remove(device.getPath());
}