Closed Bug 230270 Opened 21 years ago Closed 21 years ago

presshell leaks mCurrentEventContent

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.7alpha

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Keywords: memory-leak, Whiteboard: [patch])

Attachments

(1 file, 1 obsolete file)

The following steps cause lots of stuff to be leaked (global object, etc.).  The
root of the leak is a reference added in PresShell::ClearFrameRefs.

Steps to reproduce:
 1. ./mozilla -P <profile name> -inspector http://dbaron.org/
 2. In the upper left tree, click "HTML"
 3. At the top of the upper right, click the dropdown and choose "CSS Style Rules"
 4. Click on the one rule.
 5. Right-click on the one property
 6. Choose "Edit" in the context menu
 7. Click "OK"
 8. close the window with the "X" in the titlebar

I'll attach a patch that fixes the leak.  I'm not really happy with the patch --
the code seems quite messy.
Attached patch patch (obsolete) — Splinter Review
I didn't test which of the two changes fixes the leak, and I suspect that a
change elsewhere which maintains the invariant that either mCurrentEventContent
or mCurrentEventFrame is set, but never both, might fix it better.
Severity: normal → major
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [patch]
Target Milestone: --- → mozilla1.7alpha
It's the first of the two changes that fixes the leak.

However, the second of the two changes made me read the code there a bit more
carefully, and wonder whether the whole need for the IsZombieDocument test was
because mCurrentEventContent isn't released before assigning to mCurrentEventFrame.
Attached patch patchSplinter Review
Attachment #138516 - Attachment is obsolete: true
Attachment #138549 - Flags: superreview?(bryner)
Attachment #138549 - Flags: review?(bryner)
Attachment #138549 - Flags: superreview?(bryner)
Attachment #138549 - Flags: superreview+
Attachment #138549 - Flags: review?(bryner)
Attachment #138549 - Flags: review+
Fix checked in to trunk, 2004-01-07 14:18 -0800.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: