From 8b16b925f4ecb6d0cf0dd5b045eebe12d7f778f5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Sep 2008 21:03:01 +0200 Subject: pulse - Fix destruction logic on failed construction We need to stop the main loop first, then free the context and finally free the mainloop. Signed-off-by: Takashi Iwai --- pulse/pulse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pulse/pulse.c b/pulse/pulse.c index 022ca55..3940238 100644 --- a/pulse/pulse.c +++ b/pulse/pulse.c @@ -207,6 +207,12 @@ snd_pulse_t *pulse_new(void) return p; fail: + if (p->mainloop) + pa_threaded_mainloop_stop(p->mainloop); + + if (p->context) + pa_context_unref(p->context); + if (p->mainloop) pa_threaded_mainloop_free(p->mainloop); -- cgit