how to debug memory errors

thedeemon via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 7 22:04:59 PST 2016


On Tuesday, 8 November 2016 at 05:36:22 UTC, Era Scarecrow wrote:

>  Hmmm.. I had the impression that if something was referenced 
> by another object, then it couldn't be collected,

Another *live* object, i.e. reachable from globals and stack.
If you have a big tree and it becomes unreachable (you only had a 
pointer to its root and you nulled it), then this whole tree 
becomes garbage, and its nodes and leafs will be collected in 
unpredictable order, with destructors being run in unpredictable 
order, even when these dead nodes reference each other.




More information about the Digitalmars-d-learn mailing list