Le 14/09/13 03:42, Paul Morrison a écrit :
I am running a number of Boost threads communicating via bounded buffers. My programs seem to run properly, but I get a number of memory leaks, usually 4- and 8- byte areas, although a few are longer. As far as I can tell, they are coming from inside Boost, as there is no mention of lines in my code. OTOH, although my code runs fine, it is quite possible that there are subtle errors in it!
I am using _CRTDBG_MAP_ALLOC, which is being used correctly as it detected one area of my own that I was not freeing up, and that has been fixed.
I am running VC++ 2010 Express on a 64-bit machine.
Here is my memory leak display - I tried setting a few of the numbers as breakpoints, using_CrtSetBreakAlloc(), but most of them did not cause breaks.
The first one broke at a new in > boost::detail::basic_condition_variable::get_wait_entry() Line 180 + 0x7 bytes C++
Why wouldn't this get freed up?!
Note: <bad exception > looks ominous - where is it coming from?!
Hi,
the issue seems to be introduced in changeset
https://svn.boost.org/trac/boost/changeset/40478 improved lifetime
management of thread data.
-
- struct externally_launched_thread_deleter
- {
- externally_launched_thread* thread_data;
-
- externally_launched_thread_deleter(externally_launched_thread* thread_data_):
- thread_data(thread_data_)
- {}
-
- void operator()() const
- {
- intrusive_ptr_release(thread_data);
- }
- };
-
- }
-
+ }
thread thread::self()
@@ -156,5 +185,4 @@
externally_launched_thread* me=detail::heap_new