core-proxy: improve cleanup

Don't disconnect and destroy on errors, let the app do that.
Don't try to use a destroyed core-proxy.
This commit is contained in:
Wim Taymans 2019-12-10 12:27:12 +01:00
parent 2c492ff71f
commit 468cbb8892
2 changed files with 1 additions and 2 deletions

View file

@ -686,7 +686,6 @@ error:
this->recv_seq, res, "connection error"); this->recv_seq, res, "connection error");
pw_loop_destroy_source(loop, impl->source); pw_loop_destroy_source(loop, impl->source);
impl->source = NULL; impl->source = NULL;
pw_core_proxy_disconnect(this);
} }

View file

@ -222,7 +222,7 @@ void pw_proxy_destroy(struct pw_proxy *proxy)
if (!proxy->removed) { if (!proxy->removed) {
/* if the server did not remove this proxy, remove ourselves /* if the server did not remove this proxy, remove ourselves
* from the proxy objects and schedule a destroy. */ * from the proxy objects and schedule a destroy. */
if (proxy->core_proxy) { if (proxy->core_proxy && !proxy->core_proxy->destroyed) {
proxy->zombie = true; proxy->zombie = true;
pw_core_proxy_destroy(proxy->core_proxy, proxy); pw_core_proxy_destroy(proxy->core_proxy, proxy);
} else { } else {