From: Dave Rolsky Date: Sun, 19 Feb 2012 18:51:48 +0000 (-0600) Subject: Weaken the associated_metaclass after cloning a method. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7917b031541dcd794700b28e5b336d3bb342b694;p=gitmo%2FMoose.git Weaken the associated_metaclass after cloning a method. This doesn't seem to fix any leaks, but I'm pretty sure it's the right thing to do, since we weaken this slot when creating a new method. --- diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm index cfc5241..fca4601 100644 --- a/lib/Class/MOP/Method.pm +++ b/lib/Class/MOP/Method.pm @@ -127,6 +127,7 @@ sub clone { my $self = shift; my $clone = bless { %{$self}, @_ }, blessed($self); + weaken($clone->{associated_metaclass}) if $clone->{associated_metaclass}; $clone->_set_original_method($self);