diff options
author | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2015-03-31 12:39:53 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2015-03-31 20:36:20 +0300 |
commit | 1f659cc836cdfea956479669d9e26f6c9bad06be (patch) | |
tree | 8582d1d04347dcc4b5d30ffbbeca340169e17bfb | |
parent | 30b6c111a67ca470e02964233017d639bce250ad (diff) |
sink, source: Fix a volume change leak
When a sink or source is freed, there may be pending volume changes that
didn't get applied before the IO thread got torn down. Those pending
changes need to be freed.
The memory leak was reported here:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23162/focus=23169
Reported-by: Alexander E. Patrakov <patrakov@gmail.com>
-rw-r--r-- | src/pulsecore/sink.c | 2 | ||||
-rw-r--r-- | src/pulsecore/source.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index dafd1ccbf..f29a9b7c8 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -727,6 +727,8 @@ static void sink_free(pa_object *o) { pa_log_info("Freeing sink %u \"%s\"", s->index, s->name); + pa_sink_volume_change_flush(s); + if (s->monitor_source) { pa_source_unref(s->monitor_source); s->monitor_source = NULL; diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index eb2762197..97f6cd9b0 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -662,6 +662,8 @@ static void source_free(pa_object *o) { pa_log_info("Freeing source %u \"%s\"", s->index, s->name); + pa_source_volume_change_flush(s); + pa_idxset_free(s->outputs, NULL); pa_hashmap_free(s->thread_info.outputs); |