Commit 8aeca915 authored by Felix Paul Kühne's avatar Felix Paul Kühne

auhal: don't leak the device list

parent 8b47d5a7
...@@ -942,8 +942,13 @@ static void RebuildDeviceList(audio_output_t * p_aout) ...@@ -942,8 +942,13 @@ static void RebuildDeviceList(audio_output_t * p_aout)
struct aout_sys_t *p_sys = p_aout->sys; struct aout_sys_t *p_sys = p_aout->sys;
if (p_sys->devices) if (p_sys->devices) {
free(p_sys->devices); for (struct audio_device_t * device = p_sys->devices, *next; device != NULL; device = next) {
next = device->next;
free(device->name);
free(device);
}
}
/* Get number of devices */ /* Get number of devices */
AudioObjectPropertyAddress audioDevicesAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; AudioObjectPropertyAddress audioDevicesAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
...@@ -1550,6 +1555,12 @@ static void Close(vlc_object_t *obj) ...@@ -1550,6 +1555,12 @@ static void Close(vlc_object_t *obj)
audio_output_t *aout = (audio_output_t *)obj; audio_output_t *aout = (audio_output_t *)obj;
aout_sys_t *sys = aout->sys; aout_sys_t *sys = aout->sys;
for (struct audio_device_t * device = sys->devices, *next; device != NULL; device = next) {
next = device->next;
free(device->name);
free(device);
}
vlc_mutex_destroy(&sys->lock); vlc_mutex_destroy(&sys->lock);
free(sys); free(sys);
......
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