Skip to content

Commit

Permalink
Fix rare Null Pointer Exception when closing Serial Monitor Window
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Oct 6, 2021
1 parent 8f4c1da commit 7780fe0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/processing/app/FifoDocument.java
Expand Up @@ -164,10 +164,12 @@ public synchronized void free() {
char_head = char_tail = 0;
line_head = line_tail = 0;
char_buf = null;
for (int i=0; i < line_size; i++) {
line_buf[i] = null;
if (line_buf != null) {
for (int i=0; i < line_size; i++) {
line_buf[i] = null;
}
line_buf = null;
}
line_buf = null;
newline_offset = null;
System.gc();
}
Expand Down

0 comments on commit 7780fe0

Please sign in to comment.