Closed Bug 43579 Opened 25 years ago Closed 25 years ago

nsStdURL held past XPCOM shutdown

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 43656

People

(Reporter: dbaron, Assigned: attinasi)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

StyleSetImpl::EnableQuirkStylesheet holds its static nsIURI url defined at http://lxr.mozilla.org/seamonkey/source/layout/base/src/nsStyleSet.cpp#604 past XPCOM shutdown, leaking 1 nsStdURL (and some other things it owns, I think).
Blocks: 43561
That's Marc's.
Assignee: pierre → attinasi
Keywords: mlk
The leak is a nuisance, but it causes no harm since the memory is used until the program ends. I will change the code to use a member-variable to hold the URI as a COMPtr so that it does not show up as a leak and clutter the leak report, however that means we will have to create a new instance every time there is a new StyleSet created, which will make it slower (immeasurably, I believe).
Status: NEW → ASSIGNED
Attached patch Patch to eliminate the leak (deleted) — Splinter Review
David, can you check the patch I attached and tell me what you think? Thanks.
Keywords: patch
Target Milestone: --- → M17
Looks reasonable to me. Since we only create 8 nsStyleSet over the life of the browser when running the bloat tests it doesn't look like much performance cost. (If it were, or if you think it is, significant then you could hold a global variable counting the number of nsStyleSet, make the URI static, and release it when the count goes to 0.) The one thing that seems a little strange is putting a function call inside a macro (NS_SUCCEEDED). It's OK in this particular case, but I'd think it's bad style. If I count as a reviewer (which I'm never completely sure of...) then r=dbaron (including if you change the NS_SUCCEEDED to 2 steps).
Marking as a dup of 43656 since Inaky has a handle on a fix that will make the erported leak go away and will keep the URL instance static. David, I'll add you to the CC on that one so you can continue to track it. *** This bug has been marked as a duplicate of 43656 ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Verified dupe, particularly as the entire discussion in this bug seem to have moved over to 43656.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: