in reply to unit-testing garbage collection with Moose

Without seeing the code for Y it would be hard to know exactly what is going wrong here. But I suspect that Y is being made immutable, which means Moose is compiling an inlined DESTROY method at compile time. So when you override DEMOLISH at runtime it is too late.

Also, take a look at Test::Memory::Cycle, it will make your life easier for this stuff.

-stvn
  • Comment on Re: unit-testing garbage collection with Moose

Replies are listed 'Best First'.
Re^2: unit-testing garbage collection with Moose
by morgon (Priest) on Jul 01, 2009 at 12:01 UTC
    The class I used had not been made immutable, but I think I was (again) bitten by using an out-of-date Moose.

    The DESTROY-approach actually works with the current Moose.