Browse Source

Release audio devices when alsa_driver_new fails

Call JackAlsaDriver::Close() when alsa_driver_new() fails, to
release devices acquired just before that call. Otherwise
JackAlsaDriver::Open() will never succeed again, as re-acquiring the
same device will fail with "A handler is already registered" DBus error.
tags/v1.9.11-RC1
Jacek Konieczny 9 years ago
parent
commit
57e16b9a05
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      linux/alsa/JackAlsaDriver.cpp

+ 4
- 2
linux/alsa/JackAlsaDriver.cpp View File

@@ -346,7 +346,7 @@ int JackAlsaDriver::Open(jack_nframes_t nframes,
fPlaybackChannels = ((alsa_driver_t *)fDriver)->playback_nchannels;
return 0;
} else {
JackAudioDriver::Close();
Close();
return -1;
}
}
@@ -356,7 +356,9 @@ int JackAlsaDriver::Close()
// Generic audio driver close
int res = JackAudioDriver::Close();

alsa_driver_delete((alsa_driver_t*)fDriver);
if (fDriver) {
alsa_driver_delete((alsa_driver_t*)fDriver);
}

if (JackServerGlobals::on_device_release != NULL)
{


Loading…
Cancel
Save