
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@core-dev.co.nz +64 21 655 443

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
participants (2)
-
Jonathan Turkanis
-
Will Bryant