Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 49456
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: mikhail.maluyk [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Memory leak when processing hash
Seems to be related to bug #46058 Here is simple test case: use strict; use warnings; use Template; my $t = '[% FOREACH item IN DATA %][% FOREACH data IN item.stuff %] ... output some stuff [% END %][% END %]'; my $out; my $tt = Template->new(); while (1) { $out = undef; $tt->process(\$text, { x => {} }, \$out); }
I'm sorry, accidentally hit submit, and can't edit/delete it now, here is correct test case. use strict; use warnings; use Template; my $t = ' [% FOREACH item IN data %] [% item.val %] [% FOREACH data IN item.stuff %] ... output something [% END %] [% END %]'; my $out; my $tt = Template->new(); my $vars = { data => [ { val => 'some stuff', } ] }; while (1) { $out = undef; $tt->process(\$text, $vars, \$out); } But it works okay with: my $vars = { data => [ { val => 'some stuff', stuff => [ { name => 'bob' } ] } ] };
Ticket migrated to github as https://github.com/abw/Template2/issues/147