projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Make sure .eeprom download file is flushed on exception
[fw/altos]
/
altoslib
/
AltosEepromDownload.java
diff --git
a/altoslib/AltosEepromDownload.java
b/altoslib/AltosEepromDownload.java
index 5e035dbc008ddb4c12b23311ca940ef25e69efd3..c4ddb0e7472c851d8d9e54673c383a98f33dcc4e 100644
(file)
--- a/
altoslib/AltosEepromDownload.java
+++ b/
altoslib/AltosEepromDownload.java
@@
-147,7
+147,6
@@
public class AltosEepromDownload implements Runnable {
/* Reset per-capture variables */
want_file = false;
/* Reset per-capture variables */
want_file = false;
- eeprom_file = null;
eeprom_pending = new LinkedList<String>();
/* Set serial number in the monitor dialog window */
eeprom_pending = new LinkedList<String>();
/* Set serial number in the monitor dialog window */
@@
-185,10
+184,6
@@
public class AltosEepromDownload implements Runnable {
block - log.start_block);
}
CheckFile(true);
block - log.start_block);
}
CheckFile(true);
- if (eeprom_file != null) {
- eeprom_file.flush();
- eeprom_file.close();
- }
}
public void run () {
}
public void run () {
@@
-201,11
+196,16
@@
public class AltosEepromDownload implements Runnable {
parse_exception = null;
if (log.selected) {
monitor.reset();
parse_exception = null;
if (log.selected) {
monitor.reset();
+ eeprom_file = null;
try {
CaptureLog(log);
} catch (ParseException e) {
parse_exception = e;
}
try {
CaptureLog(log);
} catch (ParseException e) {
parse_exception = e;
}
+ if (eeprom_file != null) {
+ eeprom_file.flush();
+ eeprom_file.close();
+ }
}
if (parse_exception != null) {
failed = true;
}
if (parse_exception != null) {
failed = true;