Boost logo

Boost :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2006-09-25 22:55:14

I fixed the memory leak that showed up on windows when using the thread
library. The leak indeed was related to tss code (oposite to what I
believed before).

This also already has been fixed by Peter Dimov in the HEAD branch.

However I took a different approach, by having replaced the leaking
mutex by a CRITICAL_SECTION whose memory is static, thus is not
subject to heap tracking.

I did this because in Peters code I see a small chance that TlsFree
could get into trouble. The on_process_exit could be called multiple
times. E.g. from userland code before end of main _and_ from the
tss callbacks. (Of course this could be easily cured by use of another
once call.)

Also I think it is usefull to be able to set a breakpoint on
attached_thread_count to check if all threads (native and boost)
have already died when it comes to shutdown. This can be used as
an additional debugging aid. (The current BOOST_ASSERT does not
work well in this place, and I will try to replace it by something
more sensible. Ideas welcome! )

The difference between Bills code and my fix also is somewhat smaller,
so I hope giving less chances to regressions.

What still is left is the other leaks reported when really using tss.
I will try to tackle these with a similar approach.


Boost list run by bdawes at, gregod at, cpdaniel at, john at