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 ]) };