[Jifty-commit] r4712 - in jifty/trunk: lib/Jifty/Web/Form
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Dec 16 16:30:49 EST 2007
Author: sartak
Date: Sun Dec 16 16:30:49 2007
New Revision: 4712
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Form/Field.pm
Log:
r49135 at onn: sartak | 2007-12-16 16:30:44 -0500
Another copied weakref in Jifty::Web::Form::Field, though this code was just changed so I don't think it explains our white whale
Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm Sun Dec 16 16:30:49 2007
@@ -44,7 +44,7 @@
use base 'Jifty::Web::Form::Element';
-use Scalar::Util;
+use Scalar::Util qw/weaken/;
use Scalar::Defer qw/force/;
use HTML::Entities;
@@ -297,15 +297,16 @@
=cut
sub action {
- my $self = shift;
- if (my $action = shift @_) {
- # If we're setting the action, we need to weaken
- # the reference to not get caught in a loop
- Scalar::Util::weaken($action);
- return $self->_action($action);
+ my $self = shift;
+
+ if (@_) {
+ $self->_action(@_);
+
+ # weaken our circular reference
+ weaken $self->{_action};
}
- return $self->_action();
+ return $self->_action;
}
More information about the Jifty-commit
mailing list