Skip to content

Commit

Permalink
Close all ports before closing device
Browse files Browse the repository at this point in the history
  • Loading branch information
stashymane committed Feb 13, 2024
1 parent 4bf001b commit 5955d6e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class MidiDeviceJvm(private val device: javax.sound.midi.MidiDevice, index: Int)
override val input: MidiPort.Input = InputPort()
override val output: MidiPort.Output = OutputPort()

override fun close() = device.close()
override fun close() {
input.close()
output.close()
device.close()
}

private inner class InputPort : MidiPort.Input {
private val channel = Channel<MidiData>()
Expand Down

0 comments on commit 5955d6e

Please sign in to comment.