boost::shared_ptr question
Hey everyone,
Just a quick question about using shared pointers. If I reassign a shared_ptr point to something else, and the reference count of the previously pointed to object is 0, will the shared_ptr automatically delete the old pointer when the shared_ptr is reassigned somewhere else?
Sorry if that's unclear...
When the last shared_ptr to a bunch of memory is either destroyed or realigned, the reference count drops from 1 to 0 (I believe), and the memory is deallocated. It is a fairly typical shared pointer way of handling things.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement