Skip to content

Commit a05c672

Browse files
author
Federico Fissore
committed
SerialMonitor: dispose its window before setting its var to null, otherwise dangling disabled windows may occur. Fixes #3379
1 parent 98eb1a9 commit a05c672

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/processing/app/Editor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public boolean apply(Sketch sketch) {
137137

138138
private static JMenu portMenu;
139139

140-
static AbstractMonitor serialMonitor;
140+
static volatile AbstractMonitor serialMonitor;
141141

142142
final EditorHeader header;
143143
EditorStatus status;
@@ -2487,6 +2487,7 @@ public void handleSerial() {
24872487
// The serial monitor already exists
24882488

24892489
if (serialMonitor.isClosed()) {
2490+
serialMonitor.dispose();
24902491
// If it's closed, clear the refrence to the existing
24912492
// monitor and create a new one
24922493
serialMonitor = null;

0 commit comments

Comments
 (0)