Fix memory leak in Bugzilla::Bug->comments

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
General
P2
major
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: dylan, Assigned: dylan)

Tracking

(Blocks: 2 bugs)

Production
Dependency tree / graph

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
+++ This bug was initially created as a clone of Bug #1188428 +++
(Assignee)

Comment 1

2 years ago
Created attachment 8641098 [details] [diff] [review]
1189362_1.patch

For testing, I recommend bug 761987. It would also be cool if we could add a unit test for this. I'd have to look at the bmo_generate_blah.pl that we're using in task cluster.

use Test::Weaken 'leaks';

my $leaks = leaks(sub {
    my $bug = Bugzilla::Bug->new(761987);
    $bug->comments;

    $Bugzilla::Install::Util::_cache = {};

    $bug;
});

if ($leaks) {
    print "There were memory leaks from test 1!\n";
    printf "%d of %d original references were not freed\n", $leaks->unfreed_count(), $leaks->probe_count();
}
else {
    print "No leaks in test 1\n";
}
Attachment #8641098 - Flags: review?(glob)
Comment on attachment 8641098 [details] [diff] [review]
1189362_1.patch

Review of attachment 8641098 [details] [diff] [review]:
-----------------------------------------------------------------

r=glob

nice.
Attachment #8641098 - Flags: review?(glob) → review+
(Assignee)

Comment 3

2 years ago
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   3cd9430..d720830  master -> master
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 years ago
Blocks: 1240784
You need to log in before you can comment on or make changes to this bug.