Closed Bug 39859 Opened 25 years ago Closed 24 years ago

nsDirectoryService leaking nsLocalFile

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: inaky.gonzalez, Assigned: rayw)

References

Details

(Keywords: memory-leak)

Attachments

(2 files)

WHERE: xpcom/io/nsDirectoryService.{cpp,h} PROBLEM: nsDirectoryService instance leaking nsLocalFiles. the problem comes from the entries to nsLocalFile being stored in a hash table that was being stored trough a nsHashtable*, though later created as nsSupportsHashtable. As the inheritance wasn't done polimorphical (virtual methods and dtor), the table would not behave as it should (or as it was thought to). Also there is problems when cloning files, as the code is not taking into account that nsLocalFile::Clone() references the objects it creates. SOLLUTION: Fix nsSupportsHashtable (see bug #38606) and then fix the places where nsDirectoryService.cpp needs tweaking for the new hash table behaviour, as well as take into account that nsLocalFile::Clone() references the pointers it gives. I have patches available for this (that need the patches for the nsSupportsHashtable). We are internally reviewing them and will post them ASAP.
Ray can you take care of this while you fix the supportsHashTable bug.
Assignee: dp → rayw
Summary: nsDirectoryService leaking nsLocalFile → nsDirectoryService leaking nsLocalFile
Ray, the nsSupportsHastable bug is already fixed (I mean, I have a patch for it which covers all the known (for me) usages of it). We're reviewing it here and I want to submit it ASAP.
forgot to add mlk to kwords
Keywords: mlk
I don't know how to weight this one. I suspect if this is a frequently used service, it probably needs to be M17 as well. I'll make it that and see what others say.
Target Milestone: --- → M17
Status: NEW → ASSIGNED
I have reviewed this code. It looks correct. It is required for bug 38606 to be completely fixed and before 38606 can be put back.
Blocks: 38606
Closing this bug, fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
marking verified per last comment.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: