From: Dave Rolsky Date: Sun, 19 Feb 2012 18:51:48 +0000 (-0600) Subject: Weaken the associated_metaclass after cloning a method. X-Git-Tag: 2.0500~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc03c2b85822f6651fa0c66ad6c115ef5b92426a;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);