diff options
| author | Keith Packard <keithp@keithp.com> | 2011-03-29 09:38:23 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-03-29 09:38:23 -0700 | 
| commit | 8ade7d99f02df825e70d0a964b4648156101ef78 (patch) | |
| tree | d23fa46b953b9c8d8eb9ea4695ef2ba99311b6e3 | |
| parent | 2f9be009ef26e3d7539f5932d267d7a8a7bcb7eb (diff) | |
altosui: Display exception messages from swing thread
Flight log management exceptions were getting displayed from the log
serial I/O thread instead of the swing thread. That's a bad plan.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | altosui/AltosEepromManage.java | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 5fb70a84..b46364db 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -168,17 +168,23 @@ public class AltosEepromManage implements ActionListener {  		AltosEepromManage	manage;  		public void run () { +			Runnable r;  			try {  				flights = new AltosEepromList(serial_line, remote); -				Runnable r = new Runnable() { +				r = new Runnable() {  						public void run() { -							manage.got_flights(flights); +							got_flights(flights);  						}  					}; -				SwingUtilities.invokeLater(r);  			} catch (Exception e) { -				manage.got_exception(e); +				final Exception f_e = e; +				r = new Runnable() { +						public void run() { +							got_exception(f_e); +						} +					};  			} +			SwingUtilities.invokeLater(r);  		}  		public EepromGetList(AltosEepromManage in_manage) {  | 
