aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorLauri Kasanen <[email protected]>2012-09-02 17:04:56 +0300
committerChris Robinson <[email protected]>2012-09-02 14:16:23 -0700
commita6f9ede84958a9d599a1bbff5ba2c0f01ce1678d (patch)
tree32cac867b58a43ef6afa099b65729ed89e0dbaa0 /Alc
parent78dac1bf4a56f0e4dcdcb414a7b239222949b3e6 (diff)
alsa: Free the global config cache to remove a lot of reported leaks
Signed-off-by: Lauri Kasanen <[email protected]>
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/alsa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index b4bf83c7..c5b85b81 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -106,6 +106,7 @@ MAKE_FUNC(snd_ctl_card_info);
MAKE_FUNC(snd_ctl_card_info_get_name);
MAKE_FUNC(snd_ctl_card_info_get_id);
MAKE_FUNC(snd_card_next);
+MAKE_FUNC(snd_config_update_free_global);
#undef MAKE_FUNC
#define snd_strerror psnd_strerror
@@ -179,6 +180,7 @@ MAKE_FUNC(snd_card_next);
#define snd_ctl_card_info_get_name psnd_ctl_card_info_get_name
#define snd_ctl_card_info_get_id psnd_ctl_card_info_get_id
#define snd_card_next psnd_card_next
+#define snd_config_update_free_global psnd_config_update_free_global
#endif
@@ -270,6 +272,7 @@ static ALCboolean alsa_load(void)
LOAD_FUNC(snd_ctl_card_info_get_name);
LOAD_FUNC(snd_ctl_card_info_get_id);
LOAD_FUNC(snd_card_next);
+ LOAD_FUNC(snd_config_update_free_global);
#undef LOAD_FUNC
}
#endif
@@ -669,6 +672,9 @@ static ALCenum alsa_open_playback(ALCdevice *device, const ALCchar *deviceName)
return ALC_OUT_OF_MEMORY;
}
+ // Free alsa's global config tree. Otherwise valgrind reports a ton of leaks.
+ snd_config_update_free_global();
+
device->DeviceName = strdup(deviceName);
device->ExtraData = data;
return ALC_NO_ERROR;