31 Aug
2013
31 Aug
'13
3:14 p.m.
On 8/31/2013 12:01 AM, Dave Abrahams wrote:
There's no one correct destruction order for objects participating in a cycle. That's one reason most C++ garbage collectors collect memory but don't run destructors. How does your system deal with this?
It keeps track of the order of construction and so their are deleted in the order of construction so that their members are deleted first. It also blocks before an attempt to delete a heap object that is already being marked for deletion as you can see in ~block_ptr(): https://svn.boost.org/svn/boost/sandbox/block_ptr/boost/block_ptr.hpp -Phil