aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/midi/windows.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 932db0bcd0..b4c73e943a 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -56,6 +56,7 @@ int MidiDriver_WIN::open() {
MMRESULT res = midiOutOpen((HMIDIOUT *)&_mo, MIDI_MAPPER, (unsigned long) _streamEvent, 0, CALLBACK_EVENT);
if (res != MMSYSERR_NOERROR) {
check_error(res);
+ CloseHandle(_streamEvent);
return MERR_DEVICE_NOT_AVAILABLE;
}