Subject: | Memory cycles everywhere |
I found a bunch of unweakened circular references in Date::Manip objects via Devel::Cycle. (Test::Memory::Cycle works, too.) Some examples:
Cycle:
$Date::Manip::Base::CP->{'objs'} => \%CQ
$CQ->{'base'} => \%Date::Manip::Base::CP
Cycle:
$Date::Manip::Base::CP->{'objs'} => \%CQ
$CQ->{'tz'} => \%Date::Manip::TZ::CR
$Date::Manip::TZ::CR->{'objs'} => \%CS
$CS->{'base'} => \%Date::Manip::Base::CP
Cycle:
$Date::Manip::TZ::CR->{'objs'} => \%CS
$CS->{'tz'} => \%Date::Manip::TZ::CR
Cycle:
$Date::Manip::Base::CT->{'objs'} => \%CU
$CU->{'base'} => \%Date::Manip::Base::CT
Cycle:
$Date::Manip::TZ::CR->{'objs'} => \%CS
$CS->{'base'} => \%Date::Manip::Base::CP
$Date::Manip::Base::CP->{'objs'} => \%CQ
$CQ->{'tz'} => \%Date::Manip::TZ::CR
Cycle:
$Date::Manip::Base::CT->{'objs'} => \%CU
$CU->{'base'} => \%Date::Manip::Base::CT
Cycle:
$Date::Manip::TZ::CV->{'objs'} => \%CW
$CW->{'tz'} => \%Date::Manip::TZ::CV
Cycle:
$Date::Manip::Base::CT->{'objs'} => \%CU
$CU->{'base'} => \%Date::Manip::Base::CT
I don't see any sign of weaken being used in the modules, which it needs here. If base is a parent object of the main objects, then weaken should be applied to fix those reference loops. Every value in 'objs' seems like a good candidate, too.