From d2c952b3154523a718c49df9b5a01318c4dc709c Mon Sep 17 00:00:00 2001 From: Jamieson Christian Date: Wed, 11 Jun 2003 05:54:46 +0000 Subject: Fixed race condition in MPU401 shutdown svn-id: r8432 --- backends/midi/coreaudio.cpp | 2 ++ backends/midi/morphos.cpp | 1 + backends/midi/null.cpp | 1 - backends/midi/quicktime.cpp | 2 ++ backends/midi/seq.cpp | 1 + backends/midi/windows.cpp | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) (limited to 'backends/midi') diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index 47561f4f96..65f0e0274f 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -90,6 +90,8 @@ int MidiDriver_CORE::open() { } void MidiDriver_CORE::close() { + MidiDriver_MPU401::close(); + // Stop the output AudioOutputUnitStop(au_output); diff --git a/backends/midi/morphos.cpp b/backends/midi/morphos.cpp index b4f5fd4eff..20dd409fca 100644 --- a/backends/midi/morphos.cpp +++ b/backends/midi/morphos.cpp @@ -68,6 +68,7 @@ int MidiDriver_ETUDE::open() void MidiDriver_ETUDE::close() { + MidiDriver_MPU401::close(); exit_morphos_music(); _isOpen = false; } diff --git a/backends/midi/null.cpp b/backends/midi/null.cpp index 062bcea31c..9366bc7f1c 100644 --- a/backends/midi/null.cpp +++ b/backends/midi/null.cpp @@ -26,7 +26,6 @@ class MidiDriver_NULL : public MidiDriver_MPU401 { public: int open(); - void close() { } void send(uint32 b) { } }; diff --git a/backends/midi/quicktime.cpp b/backends/midi/quicktime.cpp index e61e6409f2..928705ba71 100644 --- a/backends/midi/quicktime.cpp +++ b/backends/midi/quicktime.cpp @@ -115,6 +115,8 @@ bail: void MidiDriver_QT::close() { + MidiDriver_MPU401::close(); + for (int i = 0; i < 15; i++) { if (qtNoteChannel[i] != NULL) NADisposeNoteChannel(qtNoteAllocator, qtNoteChannel[i]); diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp index fc7777ece2..2fab845887 100644 --- a/backends/midi/seq.cpp +++ b/backends/midi/seq.cpp @@ -87,6 +87,7 @@ int MidiDriver_SEQ::open() { } void MidiDriver_SEQ::close() { + MidiDriver_MPU401::close(); ::close(device); _isOpen = false; } diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index c4ebcfd9ce..319997d6c5 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -68,6 +68,7 @@ void MidiDriver_WIN::close() { if (!_isOpen) return; _isOpen = false; + MidiDriver_MPU401::close(); midiOutUnprepareHeader (_mo, &_streamHeader, sizeof (_streamHeader)); check_error(midiOutClose(_mo)); CloseHandle (_streamEvent); -- cgit v1.2.3