Commit eb059a78 authored by Max Kellermann's avatar Max Kellermann

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.
parent 63710ff5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment