diff --git a/linux/alsa/JackAlsaDriver.cpp b/linux/alsa/JackAlsaDriver.cpp index 675ed536..06b55e06 100644 --- a/linux/alsa/JackAlsaDriver.cpp +++ b/linux/alsa/JackAlsaDriver.cpp @@ -2367,9 +2367,12 @@ int JackAlsaDriver::port_register(const char *port_name, const char *port_type, int JackAlsaDriver::port_unregister(int port_index) { - fGraphManager->ReleasePort(fClientControl->fRefNum, port_index); - fEngine->NotifyPortRegistation(port_index, false); - return 0; + if (fGraphManager->ReleasePort(fClientControl->fRefNum, port_index) == 0) { + fEngine->NotifyPortRegistation(port_index, false); + return 0; + } else { + return -1; + } } void* JackAlsaDriver::port_get_buffer(int port, jack_nframes_t nframes)