Closed Bug 398880 Opened 18 years ago Closed 18 years ago

getElementsByClassName('') leaks an nsVoidArray

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: jruderman, Assigned: jruderman)

Details

(Keywords: memory-leak, testcase)

Attachments

(2 files)

Attached file testcase
getElementsByClassName('') leaks an nsVoidArray. I have a testcase and a patch. I found this leak with one of my own tools, but it looks like the test suite file http://lxr.mozilla.org/mozilla/source/content/base/test/test_bug357450.js should have caught this. Is nobody running mochitests with trace-refcnt? (See bug 397724 for doing so on a Tinderbox machine.)
Attached patch patchSplinter Review
Attachment #283870 - Flags: superreview?(jst)
Attachment #283870 - Flags: review?(sayrer)
Assignee: nobody → jruderman
Status: NEW → ASSIGNED
(In reply to comment #0) > Is nobody running mochitests with trace-refcnt? (See > bug 397724 for doing so on a Tinderbox machine.) I've done it, but last time I did so, we were leaking an nsVoidArray on every shutdown so I probably missed this.
Attachment #283870 - Flags: review?(sayrer) → review+
Comment on attachment 283870 [details] [diff] [review] patch + delete classes; + classes = nsnull; You don't need to null out classes here, but sr=jst either way.
Attachment #283870 - Flags: superreview?(jst) → superreview+
I'm pretty sure I have to null out |classes|, since it can be deleted (again) in the next |if| block.
Attachment #283870 - Flags: approval1.9?
Comment on attachment 283870 [details] [diff] [review] patch Oh, duh, you're right of course.
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9+
Comment on attachment 283870 [details] [diff] [review] patch This is a blocker. No need for approval once the tree reopens, unless you want to try to get approval for beta.
Attachment #283870 - Flags: approval1.9?
Target Milestone: --- → mozilla1.9 M10
Patch landed. Marking as "in-testsuite+" because this is covered by an existing mochitest, as mentioned in comment 0. Bug 397724 will get all those tests running with leak-checking enabled.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: