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.
This commit is contained in:
parent
63710ff5a6
commit
eb059a789c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user