SerialMonitor: dispose its window before setting its var to null, otherwise dangling disabled windows may occur. Fixes #3379

This commit is contained in:
Federico Fissore 2015-06-23 16:40:21 +02:00
parent 98eb1a9ee2
commit a05c672750
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,7 @@ public class Editor extends JFrame implements RunnerListener {
private static JMenu portMenu;
static AbstractMonitor serialMonitor;
static volatile AbstractMonitor serialMonitor;
final EditorHeader header;
EditorStatus status;
@ -2487,6 +2487,7 @@ public class Editor extends JFrame implements RunnerListener {
// The serial monitor already exists
if (serialMonitor.isClosed()) {
serialMonitor.dispose();
// If it's closed, clear the refrence to the existing
// monitor and create a new one
serialMonitor = null;