[Rt-commit] r7084 - rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Mon Feb 26 17:03:05 EST 2007
Author: ruz
Date: Mon Feb 26 17:03:04 2007
New Revision: 7084
Modified:
rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Scrip_Overlay.pm
Log:
* don't cache object to avoid memory leaks due to circular references
Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Scrip_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Scrip_Overlay.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.2/lib/RT/Scrip_Overlay.pm Mon Feb 26 17:03:04 2007
@@ -280,22 +280,16 @@
=head2 ConditionObj
-Retuns an RT::ScripCondition object with this Scrip's IsApplicable
+Retuns an L<RT::ScripCondition> object with this Scrip's IsApplicable
=cut
sub ConditionObj {
my $self = shift;
- unless ( defined $self->{'ScripConditionObj'} ) {
- require RT::ScripCondition;
- $self->{'ScripConditionObj'} =
- RT::ScripCondition->new( $self->CurrentUser );
- if ( $self->ScripCondition ) {
- $self->{'ScripConditionObj'}->Load( $self->ScripCondition );
- }
- }
- return ( $self->{'ScripConditionObj'} );
+ my $res = RT::ScripCondition->new( $self->CurrentUser );
+ $res->Load( $self->ScripCondition );
+ return $res;
}
# }}}
@@ -442,6 +436,7 @@
}
}
};
+
if ($@) {
$RT::Logger->error( "Scrip IsApplicable " . $self->Id . " died. - " . $@ );
return (undef);
More information about the Rt-commit
mailing list