File tree 1 file changed +5
-1
lines changed
io.sloeber.ui/src/io/sloeber/ui/monitor/internal
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 16
16
public class SerialListener implements MessageConsumer {
17
17
private static boolean myPlotterFilterFlag = false ;
18
18
SerialMonitor theMonitor ;
19
+ boolean isDisposed = false ;
19
20
int theColorIndex ;
20
21
private ByteBuffer myReceivedPlotterData = ByteBuffer .allocate (2000 );
21
22
@@ -127,7 +128,8 @@ private void internalExtractAndRemovePlotterData() {
127
128
128
129
@ Override
129
130
public void dispose () {
130
- // No need to dispose something
131
+ this .isDisposed = true ;
132
+ this .myReceivedPlotterData .clear ();
131
133
}
132
134
133
135
@ Override
@@ -137,7 +139,9 @@ public void event(String event) {
137
139
@ Override
138
140
public void run () {
139
141
try {
142
+ if (!SerialListener .this .isDisposed ) {
140
143
SerialListener .this .theMonitor .ReportSerialActivity (tempString , SerialListener .this .theColorIndex );
144
+ }
141
145
} catch (Exception e ) {// ignore as we get errors when closing
142
146
// down
143
147
}
You can’t perform that action at this time.
0 commit comments