mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
pacat: Fix memory leak when draining the context.
This commit is contained in:
parent
e01a28cd53
commit
983d4c238d
1 changed files with 3 additions and 1 deletions
|
|
@ -105,6 +105,7 @@ static void context_drain_complete(pa_context*c, void *userdata) {
|
|||
|
||||
/* Stream draining complete */
|
||||
static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
|
||||
pa_operation *o = NULL;
|
||||
|
||||
if (!success) {
|
||||
pa_log(_("Failed to drain stream: %s"), pa_strerror(pa_context_errno(context)));
|
||||
|
|
@ -118,9 +119,10 @@ static void stream_drain_complete(pa_stream*s, int success, void *userdata) {
|
|||
pa_stream_unref(stream);
|
||||
stream = NULL;
|
||||
|
||||
if (!pa_context_drain(context, context_drain_complete, NULL))
|
||||
if (!(o = pa_context_drain(context, context_drain_complete, NULL)))
|
||||
pa_context_disconnect(context);
|
||||
else {
|
||||
pa_operation_unref(o);
|
||||
if (verbose)
|
||||
pa_log(_("Draining connection to server."));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue