nsTypedSelection cycle collection should traverse to mSelectionListeners

RESOLVED FIXED in mozilla1.9.2a1

Status

()

P4
normal
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({memory-leak})

Trunk
mozilla1.9.2a1
memory-leak
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I just got a leak monitor alert after closing a view-source window:

Leaks in window 0x20839d00:
[+] [leaked object] (20840b00) = [Object]
 [ ] timeout = 0
 [ ] notifySelectionChanged (20840b40, chrome://global/content/viewSource.js, 25-29) = [Function]

The leak went away after the next GC (I got a "reclaimed leak alert").

I can't figure out how to get this to happen again.


However, from looking at code, I'm willing to guess that it might not have happened in the first place if nsTypedSelection's cycle collection implementation traversed and unlinked its mSelectionListeners.
Attachment #374536 - Flags: superreview?(peterv)
Attachment #374536 - Flags: superreview+
Attachment #374536 - Flags: review?(peterv)
Attachment #374536 - Flags: review+
Comment on attachment 374536 [details] [diff] [review]
patch

I think I was worried about selection listeners not getting notifications of the removal of the ranges. I guess we can try it out.
BTW, I don't think the notifications from the removal of the ranges in unlink is a problem, because unlink happens from the GC callback for JSGC_END.
http://hg.mozilla.org/mozilla-central/rev/443174a68358
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
OS: Linux → All
Priority: -- → P4
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.