From e88365cbb4b2c93cbdf2deceba0cafa92482ee13 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Tue, 20 Jul 2010 08:12:15 -0400 Subject: [PATCH] Ignore calls to DESTROY in AUTOLOAD, as a matter of policy. --- lib/WebGUI/Form.pm | 1 + lib/WebGUI/FormValidator.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 4c6bf485d..8486fa911 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -57,6 +57,7 @@ Dynamically creates functions on the fly for all the different form control type sub AUTOLOAD { our $AUTOLOAD; + return if $AUTOLOAD =~ m/::DESTROY$/; my $name = ucfirst((split /::/, $AUTOLOAD)[-1]); my $session = shift; my @params = @_; diff --git a/lib/WebGUI/FormValidator.pm b/lib/WebGUI/FormValidator.pm index 9df082177..9920cd004 100644 --- a/lib/WebGUI/FormValidator.pm +++ b/lib/WebGUI/FormValidator.pm @@ -70,6 +70,7 @@ sub AUTOLOAD { my $params = shift; my @args = @_; + return if $AUTOLOAD =~ m/::DESTROY$/; my $name = ucfirst((split /::/, $AUTOLOAD)[-1]); $params = {name=>$params} if ref ($params) ne "HASH"; my $control = eval { WebGUI::Pluggable::instanciate("WebGUI::Form::".$name, "new", [ $self->session, $params ]) };