I am stepping through the source code for boost::shared_ptr and upon construction the reference counter calls atomic increment once. However, on destruction I see that atomic decrement is called twice, connected to the weak reference?
However, how can this work? One increment on construction yet two decrements on destruction, once in release()
and again in weak_release()
?
Aucun commentaire:
Enregistrer un commentaire