Skip to content

Commit

Permalink
[java] keep the OutputStream alive
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Nov 6, 2023
1 parent 9f380b2 commit 4c8db11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/src/org/openqa/selenium/os/ExternalProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public ExternalProcess start() throws UncheckedIOException {

new Thread(
() -> {
InputStream input = process.getInputStream();
// use the CircularOutputStream as mandatory, we know it will never raise a
// IOException
try (OutputStream output = new MultiOutputStream(circular, copyOutputTo)) {
OutputStream output = new MultiOutputStream(circular, copyOutputTo);
try (InputStream input = process.getInputStream()) {
// we must read the output to ensure the process will not lock up
input.transferTo(output);
} catch (IOException ex) {
Expand Down

0 comments on commit 4c8db11

Please sign in to comment.