diff options
author | sudarsana.nagineni <sudarsana.nagineni@intel.com> | 2014-08-29 15:57:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-29 23:04:19 +0000 |
commit | a717f8a43530887262222c6796dd9baf4e885c6b (patch) | |
tree | d4ab67d1656db3bcac8f16fa260e0415d83d8c12 /media/audio | |
parent | a72d976919a59d83ebe2883ff623050802a24488 (diff) | |
download | chromium_src-a717f8a43530887262222c6796dd9baf4e885c6b.zip chromium_src-a717f8a43530887262222c6796dd9baf4e885c6b.tar.gz chromium_src-a717f8a43530887262222c6796dd9baf4e885c6b.tar.bz2 |
Fix memory leaks related to PulseAudioInputStream.
pa_stream_flush() returns a pa_operation object on success, so we must unref it by calling pa_operation_unref() to avoid memory leaks.
BUG=238493
Review URL: https://codereview.chromium.org/520613003
Cr-Commit-Position: refs/heads/master@{#292705}
Diffstat (limited to 'media/audio')
-rw-r--r-- | media/audio/pulse/pulse_input.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc index 6c9855e..b9d91c6 100644 --- a/media/audio/pulse/pulse_input.cc +++ b/media/audio/pulse/pulse_input.cc @@ -119,7 +119,9 @@ void PulseAudioInputStream::Close() { if (handle_) { // Disable all the callbacks before disconnecting. pa_stream_set_state_callback(handle_, NULL, NULL); - pa_stream_flush(handle_, NULL, NULL); + pa_operation* operation = pa_stream_flush( + handle_, &pulse::StreamSuccessCallback, pa_mainloop_); + WaitForOperationCompletion(pa_mainloop_, operation); if (pa_stream_get_state(handle_) != PA_STREAM_UNCONNECTED) pa_stream_disconnect(handle_); |