id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10337,"weak_ptr & shared_ptr causes double ""delete"" -> crash",thesaint1987@…,Peter Dimov,"I am not sure why this happens (VS2005 - VS2013) and specifically on windows (code compiles and runs fine on linux)... The following is the boost code that is responsible: void sp_counted_impl_p::release() // nothrow { if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 ) { dispose(); weak_release(); } } void sp_counted_impl_p::weak_release() // nothrow { if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 ) { destroy(); } } Look what MUST happen, when ""use_count = 1"" and ""weak_count = 1"".. It causes a double release which crashes the application. That was a real pain in the ass to track down and unfortunately I have nothing to specifically trigger this issue either. Just look at the code and it should be obvious that this is a race condition.",Bugs,new,To Be Determined,smart_ptr,Boost 1.53.0,Problem,,,