mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
pw-dump: destroy all objects not just those matching the pattern
`registry_event_global()` creates an `object` object for every object,
not just those matching `data::pattern`. However, previously
`registry_event_global_remove()` only destroyed those objects
that matched the given pattern. Fix that by destroying
every object.
Fixes #4001
Fixes 47e1f38f03
("pw-dump: also dump object removal")
This commit is contained in:
parent
0c0d520c32
commit
6d7b0284dd
|
@ -1395,20 +1395,20 @@ static void registry_event_global_remove(void *data, uint32_t id)
|
|||
if ((o = find_object(d, id)) == NULL)
|
||||
return;
|
||||
|
||||
d->state = STATE_FIRST;
|
||||
if (d->pattern != NULL && !object_matches(o, d->pattern))
|
||||
return;
|
||||
if (d->state == STATE_FIRST)
|
||||
put_begin(d, NULL, "[", 0);
|
||||
put_begin(d, NULL, "{", 0);
|
||||
put_int(d, "id", o->id);
|
||||
if (o->class && o->class->dump)
|
||||
put_value(d, "info", NULL);
|
||||
else if (o->props)
|
||||
put_value(d, "props", NULL);
|
||||
put_end(d, "}", 0);
|
||||
if (d->state != STATE_FIRST)
|
||||
put_end(d, "]\n", 0);
|
||||
if (!d->pattern || object_matches(o, d->pattern)) {
|
||||
d->state = STATE_FIRST;
|
||||
if (d->state == STATE_FIRST)
|
||||
put_begin(d, NULL, "[", 0);
|
||||
put_begin(d, NULL, "{", 0);
|
||||
put_int(d, "id", o->id);
|
||||
if (o->class && o->class->dump)
|
||||
put_value(d, "info", NULL);
|
||||
else if (o->props)
|
||||
put_value(d, "props", NULL);
|
||||
put_end(d, "}", 0);
|
||||
if (d->state != STATE_FIRST)
|
||||
put_end(d, "]\n", 0);
|
||||
}
|
||||
|
||||
object_destroy(o);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue