Skip to content

Commit

Permalink
Correctly close the NonBlockingReader to shutdown the reading thread
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Aug 30, 2017
1 parent 2003736 commit b94e9b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public PrintWriter writer() {
return writer;
}

@Override
public void close() throws IOException {
super.close();
reader.close();
}

private class InputStreamWrapper extends InputStream {

private final InputStream in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ public void close() throws IOException {
Signals.unregister(entry.getKey().name(), entry.getValue());
}
super.close();
reader.shutdown();
reader.close();
}
}

0 comments on commit b94e9b9

Please sign in to comment.