diff options
author | Max Kellermann <max@duempel.org> | 2009-04-21 22:47:08 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-04-21 22:47:08 +0200 |
commit | eb059a789c1018367c80a5344ccfd834c27fa3d3 (patch) | |
tree | bf74af5bada39ea1a8ee0cdf9d2afea29ab310ef | |
parent | 63710ff5a6fb51715aac83ca9374ef47f97d6120 (diff) | |
download | mpd-eb059a789c1018367c80a5344ccfd834c27fa3d3.tar.gz mpd-eb059a789c1018367c80a5344ccfd834c27fa3d3.tar.xz mpd-eb059a789c1018367c80a5344ccfd834c27fa3d3.zip |
alsa_mixer: call snd_config_update_free_global() in finish()
snd_config_update_free_global() frees cached ALSA configuration. This
keeps valgrind a little bit more quiet. This patch moves the call
from the open() method into the finish() method, which seems more
natural: it allows the use of the config cache, and improves the
cleanup phase.
Diffstat (limited to '')
-rw-r--r-- | src/mixer/alsa_mixer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c index 7b161cd14..fb0834338 100644 --- a/src/mixer/alsa_mixer.c +++ b/src/mixer/alsa_mixer.c @@ -61,6 +61,9 @@ alsa_mixer_finish(struct mixer *data) struct alsa_mixer *am = (struct alsa_mixer *)data; g_free(am); + + /* free libasound's config cache */ + snd_config_update_free_global(); } static void @@ -83,7 +86,6 @@ alsa_mixer_open(struct mixer *data) am->volume_set = -1; err = snd_mixer_open(&am->handle, 0); - snd_config_update_free_global(); if (err < 0) { g_warning("problems opening alsa mixer: %s\n", snd_strerror(err)); return false; |