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/Bug.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 09696f97b..327fb866c 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -66,6 +66,8 @@ use base qw(Bugzilla::Object Exporter); editable_bug_fields ); +my %CLEANUP; + ##################################################################### # Constants ##################################################################### @@ -367,6 +369,9 @@ sub new { return $error_self; } + $CLEANUP{$self->id} = $self; + weaken($CLEANUP{$self->id}); + return $self; } @@ -381,6 +386,15 @@ sub object_cache_key { return $key . ',' . Bugzilla->user->id; } +sub CLEANUP { + foreach my $bug (values %CLEANUP) { + next unless $bug; + delete $bug->{depends_on_obj}; + delete $bug->{blocks_obj}; + } + %CLEANUP = (); +} + sub check { my $class = shift; my ($param, $field) = @_; -- cgit v1.2.3-24-g4f1b