Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2005-11-15 15:27:34


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


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