pulse: don't add listener when connection failed

This commit is contained in:
Wim Taymans 2019-12-06 22:27:27 +01:00
parent d677aeeeca
commit cfeb724d58

View file

@ -1060,9 +1060,11 @@ int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t fla
if (c->core_proxy == NULL) { if (c->core_proxy == NULL) {
context_fail(c, PA_ERR_CONNECTIONREFUSED); context_fail(c, PA_ERR_CONNECTIONREFUSED);
res = -1; res = -1;
goto exit;
} }
pw_core_proxy_add_listener(c->core_proxy, &c->core_listener, &core_events, c); pw_core_proxy_add_listener(c->core_proxy, &c->core_listener, &core_events, c);
exit:
pa_context_unref(c); pa_context_unref(c);
return res; return res;