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.
In reply to Re: unit-testing garbage collection with Moose
by stvn
in thread unit-testing garbage collection with Moose
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |