boost::shared_ptr question

Started by
1 comment, last by Sir Sapo 17 years, 8 months ago
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...
My Current Project Angels 22 (4E5)
Advertisement
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.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
Thanks, just checking.

rate++ for the quick response!
My Current Project Angels 22 (4E5)

This topic is closed to new replies.

Advertisement