Closed Bug 36804 Opened 25 years ago Closed 25 years ago

[MLK] Leaking nsFactoryEntry objects

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: beard, Assigned: dp)

Details

nsComponentManagerImpl::PlatformPrePopulateRegistry() leaks nsFactoryEntry objects if multiple entries for the same CID are found in the registry. I discovered this while sanity checking the Boehm collector on Linux. Here's a patch to fix the apparent leak: Index: nsComponentManager.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/components/nsComponentManager.cpp,v retrieving revision 1.114 diff -r1.114 nsComponentManager.cpp 818a819,826 > > /* the following leaks if an entry is already in the table. */ > nsFactoryEntry *oldEntry = (nsFactoryEntry*) mFactories->Get(&key); > if (oldEntry != NULL) { > fprintf(stderr, "warning: replacing old factory entry.\n"); > mFactories->RemoveAndDelete(&key); > } >
Thanks patrick.
Status: NEW → ASSIGNED
Target Milestone: --- → M16
This is wierd. This is in the prepopulation code. The key is the classid. For a clash to happen, there should be two CIDs in the registry that are implemented by two different dlls. This aint possible. I tried your patch and I never hit the warning. So I would be really interested in the situation that you caused this to happen.
I meant, this would mean that registry list of CID has a CID listed twice. Cannot happen. Hence I am very interested in knowing the case how you made this happen.
Marking INVALID. This cannot happen. Maybe I will add an assert.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
- Per last comments, age of bug, and no reopen - Marking Verified/invalid. Please reopen if still a problem.
oops...forgot to actually mark it. doing so now.
Status: RESOLVED → VERIFIED
Component: XPCOM Registry → XPCOM
QA Contact: leger → xpcom
You need to log in before you can comment on or make changes to this bug.