Fix missing snd_dlclose() in sequencer

Call snd_dlclose() with the dlopen handle in snd_seq_close().
This commit is contained in:
Takashi Iwai 2006-04-25 17:27:26 +02:00
parent b9c53dd962
commit 9c69158f31
2 changed files with 11 additions and 1 deletions

View file

@ -915,7 +915,14 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
_err: _err:
if (type_conf) if (type_conf)
snd_config_delete(type_conf); snd_config_delete(type_conf);
return err >= 0 ? open_func(seqp, name, seq_root, seq_conf, streams, mode) : err; if (! err) {
err = open_func(seqp, name, seq_root, seq_conf, streams, mode);
if (err < 0)
snd_dlclose(h);
else
(*seqp)->dl_handle = h;
}
return err;
} }
static int snd_seq_open_noupdate(snd_seq_t **seqp, snd_config_t *root, static int snd_seq_open_noupdate(snd_seq_t **seqp, snd_config_t *root,
@ -1029,6 +1036,8 @@ int snd_seq_close(snd_seq_t *seq)
int err; int err;
assert(seq); assert(seq);
err = seq->ops->close(seq); err = seq->ops->close(seq);
if (seq->dl_handle)
snd_dlclose(seq->dl_handle);
free(seq->obuf); free(seq->obuf);
free(seq->ibuf); free(seq->ibuf);
free(seq->tmpbuf); free(seq->tmpbuf);

View file

@ -76,6 +76,7 @@ struct _snd_seq {
int streams; int streams;
int mode; int mode;
int poll_fd; int poll_fd;
void *dl_handle;
snd_seq_ops_t *ops; snd_seq_ops_t *ops;
void *private_data; void *private_data;
int client; /* client number */ int client; /* client number */