mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
wasapi2: Fix task memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6218>
This commit is contained in:
parent
b793c3e03b
commit
3bc068473b
1 changed files with 4 additions and 2 deletions
|
@ -973,6 +973,7 @@ gst_wasapi2_ring_buffer_prepare_loopback_client (GstWasapi2RingBuffer * self)
|
|||
hr = gst_wasapi2_ring_buffer_initialize_audio_client (self, client_handle,
|
||||
mix_format, &period, 0, GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER,
|
||||
nullptr, FALSE);
|
||||
CoTaskMemFree (mix_format);
|
||||
|
||||
if (!gst_wasapi2_result (hr)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to initialize audio client");
|
||||
|
@ -1117,8 +1118,6 @@ gst_wasapi2_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
|||
gst_audio_ring_buffer_set_channel_positions (buf, position);
|
||||
g_free (position);
|
||||
|
||||
CoTaskMemFree (mix_format);
|
||||
|
||||
if (!gst_wasapi2_result (hr)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to init audio client");
|
||||
goto error;
|
||||
|
@ -1184,12 +1183,15 @@ gst_wasapi2_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
|||
gst_audio_format_info_fill_silence (buf->spec.info.finfo,
|
||||
buf->memory, buf->size);
|
||||
|
||||
CoTaskMemFree (mix_format);
|
||||
|
||||
return TRUE;
|
||||
|
||||
error:
|
||||
GST_WASAPI2_CLEAR_COM (self->render_client);
|
||||
GST_WASAPI2_CLEAR_COM (self->capture_client);
|
||||
GST_WASAPI2_CLEAR_COM (self->volume_object);
|
||||
CoTaskMemFree (mix_format);
|
||||
|
||||
gst_wasapi2_ring_buffer_post_open_error (self);
|
||||
|
||||
|
|
Loading…
Reference in a new issue