Closed Bug 56762 Opened 24 years ago Closed 24 years ago

one-time leak from nsRange of 4 nsVoidArray and 1 PRMonitor

Categories

(Core :: DOM: Selection, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Keywords: memory-leak)

Attachments

(2 files)

Code in nsRange.cpp allocates and never destroys the following static variables:

PRMonitor*   nsRange::mMonitor
nsVoidArray* nsRange::mStartAncestors
nsVoidArray* nsRange::mEndAncestors
nsVoidArray* nsRange::mStartAncestorOffsets
nsVoidArray* nsRange::mEndAncestorOffsets

This can be fixed easily by a static shutdown function called from the module
destructor (nsLayoutModule::Shutdown() I guess).
Setting to Future; I don't think this will meet rtm criteria at this stage
unless someone can explain make a case for it.
Target Milestone: --- → Future
Assigning to self since I attached proposed fix.

mjudge - Could you have a look at the attached fix.  Does it seem reasonable?
In particular, is there a way you can guarantee that mMonitor is not entered
when the layout module dtor is called (it certainly shouldn't be during XPCOM
shutdown, but can you guarantee it?).
Assignee: mjudge → dbaron
Priority: P3 → P2
Target Milestone: Future → mozilla0.9
Status: NEW → ASSIGNED
the monitor should not be entered if events or JS is not processed while xpcom 
is shutdown. looks good to me. r=mjudge
Naturally, I prefer |0| over |nsnull|, but that is not something I would will on
others as a requirement.

sr=scc
Fix checked in 2000-10-29 13:38-0800.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: