Added temporary workaround for debug memory leak in Text::ASCIITable
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Setup.pm
index d3b1da1..00baaef 100644 (file)
@@ -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');
@@ -360,8 +362,8 @@ sub setup_home {
     }
 
     if ( $home ) {
-        $class->config->{home} = $home;
-        $class->config->{root} = dir($home)->subdir('root');
+        $class->config->{home} ||= $home;
+        $class->config->{root} ||= dir($home)->subdir('root');
     }
 }