On Mon, May 3, 2010 at 9:38 PM, Dan Horne <dan.ho...@redbone.co.nz> wrote: > Say Object A creates Object B, where B has an attribute that is Object A. > > If A goes out of scope, do A and B get cleaned up, or do I need to write > something in the DEMOLISH method to deal with this circular relationship?
Depends on if Object B's attribute that holds a reference to A is a weak_ref. http://search.cpan.org/dist/Moose/lib/Moose/Manual/Attributes.pod#Weak_references -Chris