Boost logo

Boost Users :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-09-24 14:23:37


Will Bryant wrote:
> Hi all/Jonathan,
>
> valgrinding my applications that use zlib reveals that the zlib filter
> classes leak memory on destruction, as the call to
> inflateInit2/deflateInit2 is not matched by a corresponding call to
> inflateEnd/deflateEnd.
>
> I notice that boost/iostreams/filter/zlib.hpp has:
>
> template<typename Alloc>
> zlib_compressor_impl<Alloc>::~zlib_compressor_impl()
> { /*reset(true, false);*/ }
>
> and:
>
> template<typename Alloc>
> zlib_decompressor_impl<Alloc>::~zlib_decompressor_impl()
> { /*reset(false, false);*/ }
>
> - which I imagine were added in response George M. Garner's note about
> what I assume was the same problem
> (http://lists.boost.org/Archives/boost/2005/03/83379.php).

Yes.

> Uncommenting those calls to reset fixes the memory leaks. Are they
> meant to be commented out in the release?

UGGHH! I have no idea why they're commented out. They definitely need to be
uncommented. Thanks for pointing it out.

Maybe I should post a patch, instead of waiting for 1.33.1.

> Cheers,
> Will

-- 
Jonathan Turkanis
www.kangaroologic.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net