Last Comment Bug 1189362 - Fix memory leak in Bugzilla::Bug->comments
: Fix memory leak in Bugzilla::Bug->comments
Status: RESOLVED FIXED
:
Product: bugzilla.mozilla.org
Classification: Other
Component: General (show other bugs)
: Production
: Unspecified Unspecified
P2 major (vote)
: ---
Assigned To: Dylan Hardison [:dylan]
:
:
Mentors:
Depends on:
Blocks: 1188428 1240784
  Show dependency treegraph
 
Reported: 2015-07-30 08:08 PDT by Dylan Hardison [:dylan]
Modified: 2016-01-19 08:07 PST (History)
4 users (show)
See Also:
Due Date:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
1189362_1.patch (826 bytes, patch)
2015-07-30 08:19 PDT, Dylan Hardison [:dylan]
glob: review+
Details | Diff | Splinter Review

Description User image Dylan Hardison [:dylan] 2015-07-30 08:08:47 PDT
+++ This bug was initially created as a clone of Bug #1188428 +++
Comment 1 User image Dylan Hardison [:dylan] 2015-07-30 08:19:12 PDT
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";
}
Comment 2 User image Byron Jones ‹:glob› 2015-07-31 00:44:57 PDT
Comment on attachment 8641098 [details] [diff] [review]
1189362_1.patch

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

r=glob

nice.
Comment 3 User image Dylan Hardison [:dylan] 2015-07-31 16:59:44 PDT
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   3cd9430..d720830  master -> master

Note You need to log in before you can comment on or make changes to this bug.