From 9a15297a823443b19661211293bb79e7f42a44e3 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Mon, 4 Jul 2016 17:36:58 -0400 Subject: Bug 1282606 - Fix TrackingFlags memory leak --- Bugzilla/Comment.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Comment.pm') diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index 69e973c7f..ff718c9e1 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -34,7 +34,7 @@ use Bugzilla::User; use Bugzilla::Util; use List::Util qw(first); -use Scalar::Util qw(blessed); +use Scalar::Util qw(blessed weaken); ############################### #### Initialization #### @@ -241,8 +241,9 @@ sub collapsed_reason { sub bug { my $self = shift; require Bugzilla::Bug; - $self->{bug} ||= new Bugzilla::Bug($self->bug_id); - return $self->{bug}; + my $bug = $self->{bug} ||= new Bugzilla::Bug($self->bug_id); + weaken($self->{bug}); + return $bug; } sub is_about_attachment { -- cgit v1.2.3-24-g4f1b