This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: close I/O channels when a process ends


David Daney wrote:

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.



I agree, I think this is the best approach. There is a side-issue of making sure that FDs get cleaned up in a timely manner so that we don't run out when sloppy programmers don't call close(): finalizers are not reliable for this. But, this is a general problem which applies to all streams, sockets, etc, not just to Process.


Regards

Bryce



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]