http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48391
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-31 16:57:05 UTC --- to summarise: there's nothing wrong with shared_ptr itself, but prior to GCC 4.6 our mutex had no destructor, so if shared_ptr uses a mutex it leaks resources mingw seem to have changed something which made this latent bug show up in GCC 4.5, possibly changing the value of __gnu_cxx::__default_lock_policy from 2 to 1 (causing a mutex to be used in shared_ptr) the GCC 4.6 branch has been fixed by this commit: http://gcc.gnu.org/viewcvs?view=revision&revision=166917 someone could either backport that fix to TDM-GCC or set __gnu_cxx::__default_lock_policy = 2