Boost logo

Boost Users :

From: 蹬三轮的 (tricycle_at_[hidden])
Date: 2006-09-16 04:31:29


I found a memory leak in boost's thread class. Here is the sample program:

void func()
{
}

int _tmain(int argc, _TCHAR* argv[])
{
   _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
   _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
   _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);

   {
       thread t(func);
       t.join();
   }

   _CrtDumpMemoryLeaks();

   return 0;
}

The output is:

The thread 'Win32 Thread' (0xb24) has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{188} normal block at 0x003A9DA8, 24 bytes long.
 Data: < - > D0 2D 15 00 FF FF FF FF 00 00 00 00 00 00 00 00
{187} normal block at 0x003A9C78, 8 bytes long.
 Data: < : > A8 9D 3A 00 01 CD CD CD
Object dump complete.

So I think boost should resolve this problem in the next version.



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