aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-01-17 12:03:22 +0100
committerMax Kellermann <max@duempel.org>2010-01-17 12:03:22 +0100
commit828a5f552f5d2cff01e588af7b686099687a7bac (patch)
tree51ee7fac9e2395f2a6b456ce4dc944f0e60dfd79 /src/output
parent26841b6058a4368821b1ba53cc10757f90ea8a7c (diff)
downloadmpd-828a5f552f5d2cff01e588af7b686099687a7bac.tar.gz
mpd-828a5f552f5d2cff01e588af7b686099687a7bac.tar.xz
mpd-828a5f552f5d2cff01e588af7b686099687a7bac.zip
output/pulse: clear the "mainloop" attribute on error
When enabling the pulse device fails, clear po->mainloop after pa_threaded_mainloop_free() has finished. This is important for the assertions. Two wrong g_free() calls were also removed.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/pulse_output_plugin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/output/pulse_output_plugin.c b/src/output/pulse_output_plugin.c
index 8769fc889..d29fbd705 100644
--- a/src/output/pulse_output_plugin.c
+++ b/src/output/pulse_output_plugin.c
@@ -244,6 +244,7 @@ pulse_output_setup_context(struct pulse_output *po, GError **error_r)
if (!pulse_output_connect(po, error_r)) {
pa_context_unref(po->context);
+ po->context = NULL;
return false;
}
@@ -315,7 +316,7 @@ pulse_output_enable(void *data, GError **error_r)
if (pa_threaded_mainloop_start(po->mainloop) < 0) {
pa_threaded_mainloop_unlock(po->mainloop);
pa_threaded_mainloop_free(po->mainloop);
- g_free(po);
+ po->mainloop = NULL;
g_set_error(error_r, pulse_output_quark(), 0,
"pa_threaded_mainloop_start() has failed");
@@ -332,7 +333,7 @@ pulse_output_enable(void *data, GError **error_r)
pa_threaded_mainloop_unlock(po->mainloop);
pa_threaded_mainloop_stop(po->mainloop);
pa_threaded_mainloop_free(po->mainloop);
- g_free(po);
+ po->mainloop = NULL;
return false;
}