Closed Bug 1189362 Opened 5 years ago Closed 5 years ago

Fix memory leak in Bugzilla::Bug->comments

Categories

(bugzilla.mozilla.org :: General, defect, P2, major)

Production

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: dylan)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1188428 +++
Attached patch 1189362_1.patchSplinter Review
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+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   3cd9430..d720830  master -> master
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Blocks: 1240784
You need to log in before you can comment on or make changes to this bug.