altosui: Close serial, join reader thread, free altos_file
authorKeith Packard <keithp@keithp.com>
Thu, 29 Jul 2010 17:45:02 +0000 (10:45 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 29 Jul 2010 17:45:02 +0000 (10:45 -0700)
commit53c279b9e96da8b69837ae84038a78ca5707f2a5
tree5d843f5c8f17e99840ead4ebc9dcf046c9f4cd8b
parentb8bc9994d8bfde6116c8a509e70ddf45fc4decce
altosui: Close serial, join reader thread, free altos_file

Separating out the close and free actions ensures that the reader thread will not
access freed memory or dereference a null pointer while shutting down the
connection to the serial device. Otherwise, a race condition exists between the
serial close and the thread join.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosSerial.java
ao-tools/libaltos/libaltos.c
ao-tools/libaltos/libaltos.h