From: Shawn M Moore Date: Wed, 26 Nov 2008 02:02:02 +0000 (+0000) Subject: Weaken anonymous roles in the metaclass lookup table so that they can eventually... X-Git-Tag: 0.62~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d176529034afe200340fc7764a0021405f0152b8;p=gitmo%2FMoose.git Weaken anonymous roles in the metaclass lookup table so that they can eventually be freed --- diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 7e44f09..9145fbf 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -519,6 +519,9 @@ sub create { } } + Class::MOP::weaken_metaclass($meta->name) + if $meta->is_anon_role; + return $meta; } diff --git a/t/030_roles/036_free_anonymous_roles.t b/t/030_roles/036_free_anonymous_roles.t index a17622d..c243655 100644 --- a/t/030_roles/036_free_anonymous_roles.t +++ b/t/030_roles/036_free_anonymous_roles.t @@ -22,8 +22,5 @@ do { }; -TODO: { - local $TODO = "we don't weaken role metaclasses yet"; - ok(!$weak, "the role metaclass is freed after its last reference (from a consuming anonymous class) is freed"); -}; +ok(!$weak, "the role metaclass is freed after its last reference (from a consuming anonymous class) is freed");