CatalystX::LeakChecker found a circular reference in my app. The below
patch appears to fix, and doesn't seem to break anything...
I think this is caused by the Plack changes in Catalyst 5.9, but I
wasn't able to test if it happened on older versions of Catalyst as
well.
diff --git a/lib/Catalyst/Controller/FormBuilder/Action.pm b/lib/Catalyst/Controller/FormBuilder/Action.pm
index be476b7..29fad7a 100644
--- a/lib/Catalyst/Controller/FormBuilder/Action.pm
+++ b/lib/Catalyst/Controller/FormBuilder/Action.pm
@@ -133,6 +133,7 @@ sub execute {
my $form = $self->_setup_form(@_);
Scalar::Util::weaken($form->{c});
+ Scalar::Util::weaken($form->{params});
$controller->_formbuilder($form);
$self->maybe::next::method(@_);
$controller->_formbuilder($form); # keep the same form in case of forwards