mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 08:58:01 +02:00
object-manager: remove old global when exposing new global with same id
Sometimes, especially when running the wireplumber daemon with valgrind, a new global with the same Id as another old global owned by a proxy wants to be exposed before the old proxy is destroyed. If this happens, instead of returning with an assertion error, we remove the old global and we export the new one.
This commit is contained in:
parent
4275d91675
commit
2900dc1c23
1 changed files with 7 additions and 0 deletions
|
|
@ -1066,6 +1066,13 @@ expose_tmp_globals (WpCore *core, GAsyncResult *res, WpRegistry *self)
|
|||
if (g->flags == 0)
|
||||
continue;
|
||||
|
||||
/* if old global is owned by proxy, remove it */
|
||||
if (self->globals->len > g->id) {
|
||||
WpGlobal *old_g = g_ptr_array_index (self->globals, g->id);
|
||||
if (old_g && (old_g->flags & WP_GLOBAL_FLAG_OWNED_BY_PROXY))
|
||||
wp_global_rm_flag (old_g, WP_GLOBAL_FLAG_OWNED_BY_PROXY);
|
||||
}
|
||||
|
||||
g_return_if_fail (self->globals->len <= g->id ||
|
||||
g_ptr_array_index (self->globals, g->id) == NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue