diff --git a/source/modules/rtaudio/RtAudio.cpp b/source/modules/rtaudio/RtAudio.cpp index 27a0c8323..5fce9b24b 100644 --- a/source/modules/rtaudio/RtAudio.cpp +++ b/source/modules/rtaudio/RtAudio.cpp @@ -6681,7 +6681,9 @@ unsigned int RtApiAlsa :: getDeviceCount( void ) nDevices++; } nextcard: - snd_ctl_close( handle ); + if (result == 0) { + snd_ctl_close( handle ); + } snd_card_next( &card ); }