diff options
Diffstat (limited to 'alsa-binding/Alsa-RegEvt.c')
-rw-r--r-- | alsa-binding/Alsa-RegEvt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alsa-binding/Alsa-RegEvt.c b/alsa-binding/Alsa-RegEvt.c index 41db207..035806e 100644 --- a/alsa-binding/Alsa-RegEvt.c +++ b/alsa-binding/Alsa-RegEvt.c @@ -235,8 +235,9 @@ PUBLIC void alsaEvtSubcribe(afb_req request) { // increase usage count and return success sndHandles[idx].ucount++; + snd_ctl_close(ctlDev); afb_req_success(request, NULL, NULL); - return; + // use OnErrorExit OnErrorExit: if (ctlDev) snd_ctl_close(ctlDev); @@ -277,6 +278,8 @@ STATIC json_object *alsaProbeCardId(afb_req request) { shortname = snd_ctl_card_info_get_name(cardinfo); longname = snd_ctl_card_info_get_longname(cardinfo); + snd_ctl_close(ctlDev); + // check if short|long name match if (!strcmp(sndname, ctlName)) break; if (!strcmp(sndname, shortname)) break; |