Skip to content

Commit 1b79aed

Browse files
committed
Clarify onstatechange's effect on lifetime.
Fixes #134.
1 parent 4bc44eb commit 1b79aed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ <h2 id="MIDIAccess"><a>MIDIAccess</a> Interface</h2>
325325
MUST be supported by all objects implementing the
326326
<code><a>MIDIAccess</a></code> interface.
327327
</p>
328+
<p class="note">It is important to understand that leaving an <a>EventHandler</a> attached to this object will prevent it from being garbage-collected; when finished using the <a>MIDIAccess</a>, you should remove any <a>onstatechange<a> listeners.</p>
328329
<p id="event-midiaccess-statechange">
329330
Whenever a previously unavailable MIDI port becomes available for use, or an existing port changes the state attribute,
330331
the user agent SHOULD run the following steps:</p>
@@ -442,6 +443,7 @@ <h2 id="MIDIPort"><a>MIDIPort</a> Interface</h2>
442443
MUST be supported by all objects implementing
443444
<code><a>MIDIPort</a></code> interface.
444445
</p>
446+
<p class="note">It is important to understand that leaving an <a>EventHandler</a> attached to this object will prevent it from being garbage-collected; when finished using the <a>MIDIPort</a>, you should remove any <a>onstatechange<a> listeners.</p>
445447
</dd>
446448
<dt>Promise&lt;MIDIPort&gt; open()</dt>
447449
<dd>

0 commit comments

Comments
 (0)