Flush and close the eeprom file even if an exception occurs to make
sure that contents of the file aren't lost.
Signed-off-by: Keith Packard <keithp@keithp.com>
/* Reset per-capture variables */
want_file = false;
- eeprom_file = null;
eeprom_pending = new LinkedList<String>();
/* Set serial number in the monitor dialog window */
block - log.start_block);
}
CheckFile(true);
- if (eeprom_file != null) {
- eeprom_file.flush();
- eeprom_file.close();
- }
}
public void run () {
parse_exception = null;
if (log.selected) {
monitor.reset();
+ eeprom_file = null;
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;