Closed Bug 397305 Opened 17 years ago Closed 17 years ago

Leaking an nsStringBuffer+nsCStringArray (nsVoidArray) determining whether file paths start with a volume name

Categories

(Core :: Networking, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: dbaron)

References

()

Details

(Keywords: memory-leak)

Attachments

(2 files)

URL and attached leak tree say it all; without this fixed RLk won't drop to 0 on the Mac tinderboxen.  With the patch from bug 397134 applied, these are the only leaks I see running RLk, but I've been getting slightly flaky results running the test, so I don't entirely trust a fix here plus a fix there to drop RLk to 0.

I don't know what the right fix is here to free the array at shutdown.  It may involve moving |net_GetFileFromURLSpec| into some utility class which can be allocated as a singleton in the IO service, or something like that.  In any case, I don't think we can localize a fix for this to just that function, and we're going to have to rejigger the way every platform does that test at least a little.
Flags: blocking1.9?
The right fix here is to free this thing at shutdown.  In general, static objects with ctors (as here) are a really bad idea; for one thing, they prevent easy XPCOM restart.  So really, we should dynamically allocate it in the module ctor and destroy it in the module dtor.
Keywords: helpwanted
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Blocks: 398292
Attached patch patchSplinter Review
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #283252 - Flags: superreview?(bzbarsky)
Attachment #283252 - Flags: review?(bzbarsky)
Comment on attachment 283252 [details] [diff] [review]
patch

r+sr+a=bzbarsky
Attachment #283252 - Flags: superreview?(bzbarsky)
Attachment #283252 - Flags: superreview+
Attachment #283252 - Flags: review?(bzbarsky)
Attachment #283252 - Flags: review+
Attachment #283252 - Flags: approval1.9+
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: helpwanted
Resolution: --- → FIXED
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: