softdsp-endpoint: improve destruction sequence

- Set the node proxy to NULL when it is destroyed externally
so that we don't try to destroy it a second time in finalize.
- Don't remove the dsp_listener, as this is already done inside
the node proxy destroy sequence (but keep removing the node
listener to avoid calling node_proxy_destroy() from inside
finalize())
This commit is contained in:
George Kiagiadakis 2019-06-11 10:57:56 +03:00
parent c9f03b2cad
commit acc3eef294

View file

@ -224,6 +224,7 @@ node_proxy_destroy(void *data)
{
WpPwAudioSoftdspEndpoint *self = data;
self->node_proxy = NULL;
wp_endpoint_unregister (WP_ENDPOINT (self));
}
@ -281,10 +282,8 @@ endpoint_finalize (GObject * object)
}
/* Remove and destroy the dsp_proxy */
if (self->dsp_proxy) {
spa_hook_remove (&self->dsp_listener);
if (self->dsp_proxy)
pw_proxy_destroy ((struct pw_proxy *) self->dsp_proxy);
}
G_OBJECT_CLASS (endpoint_parent_class)->finalize (object);
}