]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pulse - Fix destruction logic on failed construction
authorLennart Poettering <mznyfn@0pointer.de>
Thu, 25 Sep 2008 19:03:01 +0000 (21:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 26 Sep 2008 09:47:40 +0000 (11:47 +0200)
We need to stop the main loop first, then free the context and finally
free the mainloop.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
pulse/pulse.c

index 022ca55476ec089e4320858a37036f00ee155847..39402382d549e8d24dd85ee7df61160376706245 100644 (file)
@@ -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);