aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-10 11:49:45 -0400
committerDave Reisner <dreisner@archlinux.org>2012-05-10 11:49:45 -0400
commit00e4d0b7ab53f36ec1608f5ccd52130c91ee5fa7 (patch)
tree0b320f652520b3ae46329f180331d940f45b4704
parentb219b6e2a315b082fe156974e7b4bf6ec7a061c7 (diff)
downloadmirror-ponymix-00e4d0b7ab53f36ec1608f5ccd52130c91ee5fa7.tar.gz
mirror-ponymix-00e4d0b7ab53f36ec1608f5ccd52130c91ee5fa7.tar.bz2
mirror-ponymix-00e4d0b7ab53f36ec1608f5ccd52130c91ee5fa7.zip
free full list of sinks on deinit
-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)