diff options
Diffstat (limited to 'audio/mpu401.cpp')
-rw-r--r-- | audio/mpu401.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/audio/mpu401.cpp b/audio/mpu401.cpp index 8d1e5b6047..4834772c07 100644 --- a/audio/mpu401.cpp +++ b/audio/mpu401.cpp @@ -105,11 +105,14 @@ MidiDriver_MPU401::~MidiDriver_MPU401() { } void MidiDriver_MPU401::close() { - if (_timer_proc) + if (_timer_proc) { g_system->getTimerManager()->removeTimerProc(_timer_proc); - _timer_proc = 0; - for (int i = 0; i < 16; ++i) - send(0x7B << 8 | 0xB0 | i); + _timer_proc = 0; + } + if (isOpen()) { + for (int i = 0; i < 16; ++i) + send(0x7B << 8 | 0xB0 | i); + } } uint32 MidiDriver_MPU401::property(int prop, uint32 param) { |