Skip to contentSkip to conversation

alsa-plugins: Fix destruction logic on failed construction

PATCH New Lennart Poettering 1 participant 1 message Sep 25, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-plugins: Fix destruction logic on failed construction

Heya!

We need to stop the main loop first, then free the context and finally free the mainloop.

---
 pulse/pulse.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
pulse/pulse.c +6 -0
index 022ca55..3940238 100644
@@ -208,6 +208,12 @@ snd_pulse_t *pulse_new(void)
 
 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);
 
 	if (p->main_fd >= 0)
Signature · 8 lines
1.6.0.1

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4