Closed Bug 1934670 Opened 2 months ago Closed 2 months ago

MIDIInputMap::mPorts and MIDIOutputMap::mPorts should be cycle collected

Categories

(Core :: DOM: Device Interfaces, defect)

defect

Tracking

()

RESOLVED FIXED
135 Branch
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.

This is required to be able to traverse nsTHashMap/nsBaseHashtable types which
have these basic key types, but non-basic value types.

Assignee: nobody → nika
Status: NEW → ASSIGNED

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.

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e321dac5cc0e Part 1: Add dummy traverse implementations for basic hash key types, r=mccr8 https://hg.mozilla.org/integration/autoland/rev/d43f6c559373 Part 2: Cycle-collect across more MIDI port edges, r=mccr8
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: