From d7208303b8e0d025490f338241b2abb24dc5f1f4 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Fri, 31 Jul 2015 19:59:00 -0400 Subject: Bug 1189362 - Fix memory leak in Bugzilla::Bug->comments --- Bugzilla/Bug.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 256784022..389747011 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -57,7 +57,7 @@ use List::Util qw(min max first); use Storable qw(dclone); use URI; use URI::QueryParam; -use Scalar::Util qw(blessed); +use Scalar::Util qw(blessed weaken); use base qw(Bugzilla::Object Exporter); @Bugzilla::Bug::EXPORT = qw( @@ -3628,6 +3628,7 @@ sub comments { foreach my $comment (@{ $self->{'comments'} }) { $comment->{count} = $count++; $comment->{bug} = $self; + weaken($comment->{bug}); } # Some bugs may have no comments when upgrading old installations. Bugzilla::Comment->preload($self->{'comments'}) if @{ $self->{'comments'} }; -- cgit v1.2.3-24-g4f1b