From: Andy Grundman Date: Fri, 23 Sep 2005 19:29:17 +0000 (+0000) Subject: Added temporary workaround for debug memory leak in Text::ASCIITable X-Git-Tag: 5.7099_04~1235 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=9edb1eb325435873ed55f643d671cb050bd8b659;hp=c2e37e5972fc1dd50f7eebdd0b73cea11ae1b8f4 Added temporary workaround for debug memory leak in Text::ASCIITable --- diff --git a/Changes b/Changes index 55b8d78..6292496 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ This file documents the revision history for Perl extension Catalyst. - Fixed bug in dispatcher where an invalid path could call a valid action. (Andy Grundman) - Fixed Helper so it works with CRLF line-endings. (Andy Grundman) + - Added workaround for debug mode memory leak in Text::ASCIITable. + (Andy Grundman) 5.33 2005-08-10 15:25:00 - Now with updated manifest. diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 9a1149b..bf3049b 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -7,7 +7,6 @@ use Catalyst::Exception; use Catalyst::Log; use Catalyst::Utils; use NEXT; -use Text::ASCIITable; use Path::Class; our $CATALYST_SCRIPT_GEN = 4; diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index cb01934..99bbba7 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -428,6 +428,7 @@ sub setup_actions { my $actions = $self->actions; my $privates = Text::ASCIITable->new; + undef $privates->{tiedarr}; # work-around for a memory leak $privates->setCols( 'Private', 'Class' ); $privates->setColWidth( 'Private', 36, 1 ); $privates->setColWidth( 'Class', 37, 1 ); @@ -451,6 +452,7 @@ sub setup_actions { if ( @{ $privates->{tbl_rows} } ); my $publics = Text::ASCIITable->new; + undef $publics->{tiedarr}; # work-around for a memory leak $publics->setCols( 'Public', 'Private' ); $publics->setColWidth( 'Public', 36, 1 ); $publics->setColWidth( 'Private', 37, 1 ); @@ -466,6 +468,7 @@ sub setup_actions { if ( @{ $publics->{tbl_rows} } ); my $regexes = Text::ASCIITable->new; + undef $regexes->{tiedarr}; # work-around for a memory leak $regexes->setCols( 'Regex', 'Private' ); $regexes->setColWidth( 'Regex', 36, 1 ); $regexes->setColWidth( 'Private', 37, 1 ); diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index de7e082..36b839b 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -419,6 +419,7 @@ sub handler { my $av = sprintf '%.3f', ( $elapsed == 0 ? '??' : ( 1 / $elapsed ) ); my $t = Text::ASCIITable->new; + undef $t->{tiedarr}; # work-around for a memory leak $t->setCols( 'Action', 'Time' ); $t->setColWidth( 'Action', 64, 1 ); $t->setColWidth( 'Time', 9, 1 ); @@ -519,6 +520,7 @@ sub prepare { if ( $c->debug && keys %{ $c->req->params } ) { my $t = Text::ASCIITable->new; + undef $t->{tiedarr}; # work-around for a memory leak $t->setCols( 'Key', 'Value' ); $t->setColWidth( 'Key', 37, 1 ); $t->setColWidth( 'Value', 36, 1 ); diff --git a/lib/Catalyst/Setup.pm b/lib/Catalyst/Setup.pm index be83e17..00baaef 100644 --- a/lib/Catalyst/Setup.pm +++ b/lib/Catalyst/Setup.pm @@ -95,6 +95,7 @@ sub setup { if ( @plugins ) { my $t = Text::ASCIITable->new; + undef $t->{tiedarr}; # work-around for a memory leak $t->setOptions( 'hide_HeadRow', 1 ); $t->setOptions( 'hide_HeadLine', 1 ); $t->setCols('Class'); @@ -127,6 +128,7 @@ sub setup { if ( $class->debug ) { my $t = Text::ASCIITable->new; + undef $t->{tiedarr}; # work-around for a memory leak $t->setOptions( 'hide_HeadRow', 1 ); $t->setOptions( 'hide_HeadLine', 1 ); $t->setCols('Class');