You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stevo Slavić <ss...@gmail.com> on 2011/04/16 21:29:17 UTC

Commons compress, ZipFile and finalize

Hello Apache Commons users,

Is there a reason why ZipFile shouldn't call it's closeQuietly or just
close on finalize?

Now (commons compress 1.1), if ZipFile is garbage collected without
being closed first, file descriptor leak will occur.

Regards,
Stevo.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: Commons compress, ZipFile and finalize

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-04-16, Stevo Slavić wrote:

> Is there a reason why ZipFile shouldn't call it's closeQuietly or just
> close on finalize?

Not really.  Added to trunk in svn revision 1094224.

Of course you should always make sure that your code closes all
resources properly rather than relying on the GC.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org