[Catalyst-commits] r13525 -
Catalyst-View-TT/branches/export_methods/lib/Catalyst/View
lukes at dev.catalyst.perl.org
lukes at dev.catalyst.perl.org
Wed Aug 25 09:00:42 GMT 2010
Author: lukes
Date: 2010-08-25 10:00:42 +0100 (Wed, 25 Aug 2010)
New Revision: 13525
Modified:
Catalyst-View-TT/branches/export_methods/lib/Catalyst/View/TT.pm
Log:
weaken ctx to avoid leakage
Modified: Catalyst-View-TT/branches/export_methods/lib/Catalyst/View/TT.pm
===================================================================
--- Catalyst-View-TT/branches/export_methods/lib/Catalyst/View/TT.pm 2010-08-25 08:56:13 UTC (rev 13524)
+++ Catalyst-View-TT/branches/export_methods/lib/Catalyst/View/TT.pm 2010-08-25 09:00:42 UTC (rev 13525)
@@ -8,7 +8,7 @@
use Template;
use Template::Timer;
use MRO::Compat;
-use Scalar::Util qw/blessed/;
+use Scalar::Util qw/blessed weaken/;
our $VERSION = '0.34';
@@ -283,8 +283,10 @@
Catalyst::Exception->throw( "$method_name not found in TT view" );
}
my $method_body = $method->body;
+ my $weak_ctx = $c;
+ weaken $weak_ctx;
my $sub = sub {
- $self->$method_body($c, @_);
+ $self->$method_body($weak_ctx, @_);
};
$vars{$method_name} = $sub;
}
More information about the Catalyst-commits
mailing list