File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed 
java/src/org/openqa/selenium/os Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -317,8 +317,11 @@ public void shutdown() {
317317   */ 
318318  public  void  shutdown (Duration  timeout ) {
319319    try  {
320-       if  (process .supportsNormalTermination ()) {
321-         process .destroy ();
320+       // use the handle to prevent closing the stdin, stdout, stderr streams 
321+       ProcessHandle  handle  = process .toHandle ();
322+ 
323+       if  (handle .supportsNormalTermination ()) {
324+         handle .destroy ();
322325
323326        try  {
324327          if  (process .waitFor (timeout .toMillis (), MILLISECONDS )) {
@@ -330,7 +333,7 @@ public void shutdown(Duration timeout) {
330333        }
331334      }
332335
333-       process .destroyForcibly ();
336+       handle .destroyForcibly ();
334337      try  {
335338        process .waitFor (timeout .toMillis (), MILLISECONDS );
336339      } catch  (InterruptedException  ex ) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments