mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05: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
					
				
					 1 changed files with 14 additions and 14 deletions
				
			
		| 
						 | 
					@ -1395,9 +1395,8 @@ static void registry_event_global_remove(void *data, uint32_t id)
 | 
				
			||||||
	if ((o = find_object(d, id)) == NULL)
 | 
						if ((o = find_object(d, id)) == NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!d->pattern || object_matches(o, d->pattern)) {
 | 
				
			||||||
		d->state = STATE_FIRST;
 | 
							d->state = STATE_FIRST;
 | 
				
			||||||
	if (d->pattern != NULL && !object_matches(o, d->pattern))
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
		if (d->state == STATE_FIRST)
 | 
							if (d->state == STATE_FIRST)
 | 
				
			||||||
			put_begin(d, NULL, "[", 0);
 | 
								put_begin(d, NULL, "[", 0);
 | 
				
			||||||
		put_begin(d, NULL, "{", 0);
 | 
							put_begin(d, NULL, "{", 0);
 | 
				
			||||||
| 
						 | 
					@ -1409,6 +1408,7 @@ static void registry_event_global_remove(void *data, uint32_t id)
 | 
				
			||||||
		put_end(d, "}", 0);
 | 
							put_end(d, "}", 0);
 | 
				
			||||||
		if (d->state != STATE_FIRST)
 | 
							if (d->state != STATE_FIRST)
 | 
				
			||||||
			put_end(d, "]\n", 0);
 | 
								put_end(d, "]\n", 0);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	object_destroy(o);
 | 
						object_destroy(o);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue