From 00e4d0b7ab53f36ec1608f5ccd52130c91ee5fa7 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 10 May 2012 11:49:45 -0400 Subject: free full list of sinks on deinit --- pulsemix.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3