Subject: | Memory leak (cycle) with body member and $self |
The 'body' key points to a function that gets $self through closure,
resulting in a cycle. Using Scalar::Util::weaken() on $self in
_wrapped_body() fixes the problem as far as I know.
Cycle (2):
$Class::MOP::Class::Immutable::Moose::Meta::Class::A->
{'methods'} => \%G
$G->{'execute'} => \
%MooseX::Method::Signatures::Meta::Method::H
$MooseX::Method::Signatures::Meta::Method::H->{'body'} =>
\&I
$I variable $self => \$J
$$J => \$K
$$K => \
%MooseX::Method::Signatures::Meta::Method::H