[IOStreams] Memory leaks when using zlib_compressor
Hi there, I couldn't find anything in the archives for my problem. Purify is showing several memory leaks when I execute the following program: int _tmain(int argc, _TCHAR* argv[]) { // prepare some data to write unsigned int nSize = 1000000; char* pBits = new char[nSize]; ::memset( pBits , 0 , nSize ); for( unsigned int i = 0; i < nSize; i++ ) { pBits[i] = i; } // write to file io::filtering_ostream out; out.push( io::zlib_compressor() ); out.push( io::file_sink( "test.zip", std::ios::binary )); out << nSize; out.write( pBits , nSize ); // clean up delete[] pBits; return 0; } I think the program is right. I'm using Boost 1.33 with VC 7.1. Here is what purify spits out: [I] Summary of all memory leaks... {268108 bytes, 6 blocks} [I] MPK: Potential memory leak of 196608 bytes from 3 blocks allocated in boost::iostreams::detail::zlib_base::do_init(zlib_params::iostreams::boost const&,bool,(*)(void *,UINT,UINT),(*)(void *,void *),void *) [IOStreams.exe] [W] MLK: Memory leak of 71360 bytes from 2 blocks allocated in boost::iostreams::detail::zlib_base::do_init(zlib_params::iostreams::boost const&,bool,(*)(void *,UINT,UINT),(*)(void *,void *),void *) [IOStreams.exe] Is that a know issue? I guess so, but has it been resolved? Thanks, Christian
Christian Henning wrote:
Hi there, I couldn't find anything in the archives for my problem. Purify is showing several memory leaks when I execute the following
<snip>
Is that a know issue? I guess so, but has it been resolved?
There was a memory leak in 1.33.0. It should be fixed in 1.33.1 beta (now available at boost.org). Let me know if you have this problem with 1.33.1 beta.
Thanks, Christian
-- Jonathan Turkanis www.kangaroologic.com
I can confirm that Purify is not showing any memory leaks due to the iostreams lib. I tested boost 1.33.1 beta with the program I submitted earlier. Thanks, Christian
Christian Henning wrote:
I can confirm that Purify is not showing any memory leaks due to the iostreams lib. I tested boost 1.33.1 beta with the program I submitted earlier.
Good news. Thank!
Thanks, Christian
-- Jonathan Turkanis www.kangaroologic.com
participants (2)
-
Christian Henning
-
Jonathan Turkanis