aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pulsemix.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pulsemix.c b/pulsemix.c
index abe8c54..b68cb17 100644
--- a/pulsemix.c
+++ b/pulsemix.c
@@ -242,9 +242,16 @@ static void set_default_sink(struct pulseaudio_t *pulse, const char *sinkname)
static void pulse_deinit(struct pulseaudio_t *pulse)
{
+ struct sink_t *sink = pulse->sinks;
+
pa_context_disconnect(pulse->cxt);
pa_mainloop_free(pulse->mainloop);
- free(pulse->sinks);
+
+ while (sink) {
+ sink = pulse->sinks->next_sink;
+ free(pulse->sinks);
+ pulse->sinks = sink;
+ }
}
static void pulse_init(struct pulseaudio_t *pulse, const char *clientname)