resource: destroy old core_resource

If there is already a core_resource when we are going to make a new
one, remove the old one. This can happen when there is a version
switch.
This commit is contained in:
Wim Taymans 2020-02-10 16:22:49 +01:00
parent 905e5af058
commit d2e7f75071
4 changed files with 8 additions and 2 deletions

View file

@ -320,6 +320,9 @@ static void on_start(void *data, uint32_t version)
pw_log_debug("version %d", version);
if (client->core_resource != NULL)
pw_resource_remove(client->core_resource);
if (pw_global_bind(pw_impl_core_get_global(client->core), client,
PW_PERM_RWX, version, 0) < 0)
return;