Subject: | memory leak (circular reference) |
I'm tracking down memory leaks in a persistent fastcgi app, and came
across this.
Dumping the object with Data::Dumper shows:
(irrelevant lines removed)
$VAR1 = bless( {
'INCLUDE_PATH' => [
'/path2',
'/path1'
],
'INCLUDE_PATHS' => $VAR1->{'INCLUDE_PATH'}
}, 'Template::Alloy' );
I think rather than using weaken(), simply adding the following line to
the include_paths() subroutine in Template/Alloy.pm would probably be best.
It should be inserted before $paths is returned in line 781.
$paths = [@$paths] if UNIVERSAL::isa($paths, 'ARRAY');