summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2016-07-04 23:36:58 +0200
committerDylan Hardison <dylan@mozilla.com>2016-07-04 23:36:58 +0200
commit9a15297a823443b19661211293bb79e7f42a44e3 (patch)
tree6201a329e16964b86f74a8c152e3b63d66c7339f /Bugzilla/Bug.pm
parent3bf65ba172080fbed1e7d4e285075fa67de73fed (diff)
downloadbugzilla-9a15297a823443b19661211293bb79e7f42a44e3.tar.gz
bugzilla-9a15297a823443b19661211293bb79e7f42a44e3.tar.xz
Bug 1282606 - Fix TrackingFlags memory leak
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm14
1 files changed, 14 insertions, 0 deletions
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) = @_;