mirror of https://github.com/noisymime/Arduino.git
If opening serial monitor causes an error, set it closed. Fixes #3268
This commit is contained in:
parent
a859cfb9f9
commit
b77f5f731d
|
@ -2727,6 +2727,11 @@ public class Editor extends JFrame implements RunnerListener {
|
|||
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
|
||||
}
|
||||
statusError(errorMessage);
|
||||
try {
|
||||
serialMonitor.close();
|
||||
} catch (Exception e1) {
|
||||
// noop
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
} finally {
|
||||
|
|
|
@ -99,8 +99,8 @@ public class SerialMonitor extends AbstractMonitor {
|
|||
}
|
||||
|
||||
public void close() throws Exception {
|
||||
super.close();
|
||||
if (serial != null) {
|
||||
super.close();
|
||||
int[] location = getPlacement();
|
||||
String locationStr = PApplet.join(PApplet.str(location), ",");
|
||||
PreferencesData.set("last.serial.location", locationStr);
|
||||
|
|
Loading…
Reference in New Issue