Patch: close I/O channels when a process ends

David Daney ddaney@avtrex.com
Sun Aug 8 15:30:00 GMT 2004


Andrew Haley wrote:

> I'm in favour of anything that will fix the bug, I guess.
> 

I am working on a revised patch.

>  > Opinions?
> 
> Why not read the stream till EOF, buffer it, and close the underlying
> file handles?  They can't be used anyway because the process they're
> connected to has died.

The streams in question are already open and being read, changing their
data source would be a little difficult (but not impossible).

I think once you have obtained a stream from the Process, it is your
responsibility to close it if you don't want to wait for the finalizer
to close it for you.  They are just like any other IO object in this
respect.

I agree that the streams that were never obtained from the Process
probably should be closed.

Dave.



More information about the Java-patches mailing list