I go through the source code for boost::shared_ptr, and when building the control counter causes an atomic increment once. However, upon destruction, I see that the atomic decrement is called twice, connected to a weak link?
However, how does it work? One increment in the construction of another two decrements of destruction, once in release()and again in weak_release()?
source
share