[Rt-commit] r9752 - rt/branches/3.7-RTIR-RELENG/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Wed Nov 28 03:51:57 EST 2007
Author: ruz
Date: Wed Nov 28 03:51:56 2007
New Revision: 9752
Modified:
rt/branches/3.7-RTIR-RELENG/lib/RT/Template_Overlay.pm
Log:
* fix memory leak
Modified: rt/branches/3.7-RTIR-RELENG/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/lib/RT/Template_Overlay.pm (original)
+++ rt/branches/3.7-RTIR-RELENG/lib/RT/Template_Overlay.pm Wed Nov 28 03:51:56 2007
@@ -365,6 +365,15 @@
$args{'Ticket'} = delete $args{'TicketObj'} if $args{'TicketObj'};
$args{'Transaction'} = delete $args{'TransactionObj'} if $args{'TransactionObj'};
+ $args{'Requestor'} = eval { $args{'Ticket'}->Requestors->UserMembersObj->First->Name };
+ $args{'rtname'} = RT->Config->Get('rtname');
+ if ( $args{'Ticket'} ) {
+ my $t = $args{'Ticket'}; # avoid memory leak
+ $args{'loc'} = sub { $t->loc(@_) };
+ } else {
+ $args{'loc'} = sub { $self->loc(@_) };
+ }
+
foreach my $key ( keys %args ) {
next unless ref $args{ $key };
next if ref $args{ $key } =~ /^(ARRAY|HASH|SCALAR|CODE)$/;
@@ -372,13 +381,6 @@
$args{ $key } = \$val;
}
- $args{'Requestor'} = eval { $args{'Ticket'}->Requestors->UserMembersObj->First->Name };
- $args{'rtname'} = RT->Config->Get('rtname');
- if ( $args{'Ticket'} ) {
- $args{'loc'} = sub { $args{'Ticket'}->loc(@_) };
- } else {
- $args{'loc'} = sub { $self->loc(@_) };
- }
my $is_broken = 0;
my $retval = $template->fill_in(
More information about the Rt-commit
mailing list