metadata: Added context monitor for removed globals

impl-metadata would not monitor for globals being removed.
This would cause stale metadata to remain in the
store, causing future objects on the same ids to have invalid data.
This commit is contained in:
Dimitrios Katsaros 2024-02-10 16:24:40 +01:00 committed by Wim Taymans
parent 17e6a0709b
commit 8f59508ecb
3 changed files with 21 additions and 1 deletions

View file

@ -210,6 +210,8 @@ static const struct pw_global_events global_events = {
static void context_global_removed(void *data, struct pw_global *global)
{
struct impl *impl = data;
pw_log_trace("Clearing properties for global %u in %u",
pw_global_get_id(global), pw_global_get_id(impl->global));
pw_metadata_set_property(impl->metadata,
pw_global_get_id(global), NULL, NULL, NULL);
}