From: Lennart Poettering Date: Thu, 25 Sep 2008 19:03:01 +0000 (+0200) Subject: pulse - Fix destruction logic on failed construction X-Git-Tag: v1.0.18~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8b16b925f4ecb6d0cf0dd5b045eebe12d7f778f5;p=alsa-plugins.git 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 --- 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);