summaryrefslogtreecommitdiff
path: root/src/seq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-04-25 17:27:26 +0200
committerTakashi Iwai <tiwai@suse.de>2006-04-25 17:27:26 +0200
commit9c69158f31c1a35edd6580dc4c6bcd657fd17981 (patch)
tree990785bf36fc521941ff1a9cc79ce0f24ee12bf0 /src/seq
parentb9c53dd96288c7f9defd7f812f7a0f06bf58e20e (diff)
Fix missing snd_dlclose() in sequencer
Call snd_dlclose() with the dlopen handle in snd_seq_close().
Diffstat (limited to 'src/seq')
-rw-r--r--src/seq/seq.c11
-rw-r--r--src/seq/seq_local.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/src/seq/seq.c b/src/seq/seq.c
index a2424c9a..751f7fd7 100644
--- a/src/seq/seq.c
+++ b/src/seq/seq.c
@@ -915,7 +915,14 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
_err:
if (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,
@@ -1029,6 +1036,8 @@ int snd_seq_close(snd_seq_t *seq)
int err;
assert(seq);
err = seq->ops->close(seq);
+ if (seq->dl_handle)
+ snd_dlclose(seq->dl_handle);
free(seq->obuf);
free(seq->ibuf);
free(seq->tmpbuf);
diff --git a/src/seq/seq_local.h b/src/seq/seq_local.h
index 29f9028b..3dfb2567 100644
--- a/src/seq/seq_local.h
+++ b/src/seq/seq_local.h
@@ -76,6 +76,7 @@ struct _snd_seq {
int streams;
int mode;
int poll_fd;
+ void *dl_handle;
snd_seq_ops_t *ops;
void *private_data;
int client; /* client number */