WebAudio / web-midi-api

The Web MIDI API, developed by the W3C Audio WG
http://webaudio.github.io/web-midi-api/
Other
323 stars 49 forks source link

MIDIPort close() does not cover the "pending" case #201

Open jazz-soft opened 5 years ago

jazz-soft commented 5 years ago

The function should probably cancel the pending requests from previously called open()

cwilso commented 3 years ago

Spec should be updated to mandate this.

mjwilson-google commented 11 months ago

I think this is in step 5. of https://webaudio.github.io/web-midi-api/#dfn-algorithm-to-close-a-midiport

Is it as simple as changing this: "If the output port's .state is not "connected", clear all pending send data and skip to the next step."

to this? "If the output port's .state is not "connected", or if its .connection is "pending", clear all pending send data and skip to the next step."