381876 Monitor should wait for child to finish before exiting.

This commit is contained in:
Jan Bartel 2012-06-07 00:05:04 +02:00
parent c43725bb31
commit 65ee9d0d34
1 changed files with 11 additions and 0 deletions

View File

@ -111,7 +111,18 @@ public class Monitor extends Thread
try {socket.close();}catch(Exception e){e.printStackTrace();}
try {_socket.close();}catch(Exception e){e.printStackTrace();}
if (_process!=null)
{
//if we have a child process, wait for it to finish before we stop
try
{
_process.destroy();
_process.waitFor();
}
catch (InterruptedException e)
{
System.err.println("Interrupted waiting for child to terminate");
}
}
System.exit(0);
}
else if ("status".equals(cmd))