Revision history for Perl extension Catalyst::View::TT.
-0.22 Fri Dec 16 18:25:00 2005
+0.23 Sun Mar 23 20:45:00 2006
- Added render suport. (Ash Berlin)
+
+0.22 Fri Jan 16 18:25:00 2006
- stringify $c->action for automatic template match instead of $c->req->action.
* NOTE * This will change the match to the private name of the matched action! if you
use template_suffix you have to move your templates around!
t/05appconfig.t
t/06includepath.t
t/07render.t
+t/08cycle.t
t/lib/TestApp.pm
t/lib/TestApp/root/specified_template.tt
t/lib/TestApp/root/test.tt
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Catalyst-View-TT
-version: 0.22
+version: 0.23
version_from: lib/Catalyst/View/TT.pm
installdirs: site
requires:
use Template::Timer;
use NEXT;
-our $VERSION = '0.22';
+our $VERSION = '0.23';
__PACKAGE__->mk_accessors('template');
__PACKAGE__->mk_accessors('include_path');
# Creation of template outside of call to new so that we can pass [ $self ]
# as INCLUDE_PATH config item, which then gets ->paths() called to get list
# of include paths to search for templates.
+
+ # Use a weakend copy of self so we dont have loops preventing GC from working
+ my $copy = $self;
+ Scalar::Util::weaken($copy);
+ $config->{INCLUDE_PATH} = [ sub { $copy->paths } ];
- $config->{INCLUDE_PATH} = [ $self ];
$self->{template} =
Template->new($config) || do {
my $error = Template->error();
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+plan tests => 3;
+
+use_ok('Catalyst::View::TT');
+use_ok('Catalyst::Test', 'TestApp');
+
+my $copy;
+{
+ my $view = new Catalyst::View::TT("TestApp", {});
+
+ # Can't Test::Memory::Cycle test since it doesn't detect
+ # [ sub { $copy->paths } ]
+ # as a cycle, but the above does prevent it getting garbage collected.
+ #
+ # memory_cycle_ok($view, 'No cycles in View');
+
+ $copy = $view;
+ Scalar::Util::weaken($copy);
+}
+
+ok(!defined $copy, 'Copy went out of scope');
+