Boost logo

Boost Users :

From: Will Bryant (will_at_[hidden])
Date: 2005-09-24 07:22:07


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).

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

Cheers,
Will

-- 
Will Bryant
http://carcino.gen.nz/
will_at_[hidden]
+64 21 655 443

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