Wait on the process to close so it doesn't crash and restart
Former-commit-id: cdc3142df1
Former-commit-id: 18bb29422f69ad9de58642959f01879ec6aa3e8b
This commit is contained in:
@ -366,15 +366,17 @@ public class I2PFirefox {
|
||||
}
|
||||
if (waitForProxy()){
|
||||
ProcessBuilder pb = this.defaultProcessBuilder();
|
||||
Process p = null;
|
||||
try{
|
||||
System.out.println(pb.command());
|
||||
pb.start();
|
||||
p = pb.start();
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}finally{
|
||||
System.out.println("I2PFirefox");
|
||||
try{
|
||||
pb.wait();
|
||||
System.out.println("Waiting for I2PFirefox to close...");
|
||||
p.waitFor();
|
||||
}catch(Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
|
Reference in New Issue
Block a user