mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Added missing snd_dlclose() calls
This commit is contained in:
parent
358d1998b7
commit
0d7d11889d
10 changed files with 44 additions and 4 deletions
|
|
@ -96,6 +96,8 @@ int snd_ctl_close(snd_ctl_t *ctl)
|
|||
err = ctl->ops->close(ctl);
|
||||
if (ctl->name)
|
||||
free(ctl->name);
|
||||
if (ctl->dl_handle)
|
||||
snd_dlclose(ctl->dl_handle);
|
||||
free(ctl);
|
||||
return err;
|
||||
}
|
||||
|
|
@ -589,7 +591,16 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
|
|||
_err:
|
||||
if (type_conf)
|
||||
snd_config_delete(type_conf);
|
||||
return err >= 0 ? open_func(ctlp, name, ctl_root, ctl_conf, mode) : err;
|
||||
if (err >= 0) {
|
||||
err = open_func(ctlp, name, ctl_root, ctl_conf, mode);
|
||||
if (err >= 0) {
|
||||
(*ctlp)->dl_handle = h;
|
||||
return 0;
|
||||
} else {
|
||||
snd_dlclose(h);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static int snd_ctl_open_noupdate(snd_ctl_t **ctlp, snd_config_t *root, const char *name, int mode)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ typedef struct _snd_ctl_ops {
|
|||
|
||||
|
||||
struct _snd_ctl {
|
||||
void *dl_handle;
|
||||
char *name;
|
||||
snd_ctl_type_t type;
|
||||
snd_ctl_ops_t *ops;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue