MIDIInputMap::mPorts and MIDIOutputMap::mPorts should be cycle collected
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox135 | --- | fixed |
People
(Reporter: mccr8, Assigned: nika)
Details
Attachments
(2 files)
MIDIInputMap, MIDIOutputMap, and MIDIPort are all cycle collected, so the ports in the mPorts
hash map should be traversed and unlinked.
I think a leaking test case would be something like this in JS, where m
is an input/output map and p
is a port that is in the map:
p.whatever = m;
This creates a strong reference from p
to m
, causing a cycle because there is already a strong reference from m
to p
via mPorts
.
Assignee | ||
Comment 1•2 months ago
|
||
This is required to be able to traverse nsTHashMap/nsBaseHashtable types which
have these basic key types, but non-basic value types.
Updated•2 months ago
|
Assignee | ||
Comment 2•2 months ago
|
||
This both adds traversing across the mPorts
edge, as well as turning the
reference from MIDIPort to MIDIAccess into a strong cycle-collected edge
instead of a WeakPtr.
https://hg.mozilla.org/mozilla-central/rev/e321dac5cc0e
https://hg.mozilla.org/mozilla-central/rev/d43f6c559373
Description
•