mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	global: only unregister when it was registered
This commit is contained in:
		
							parent
							
								
									c593d868fb
								
							
						
					
					
						commit
						04f77d2565
					
				
					 1 changed files with 12 additions and 9 deletions
				
			
		| 
						 | 
					@ -83,6 +83,7 @@ pw_global_new(struct pw_core *core,
 | 
				
			||||||
	this->bind = bind;
 | 
						this->bind = bind;
 | 
				
			||||||
	this->object = object;
 | 
						this->object = object;
 | 
				
			||||||
	this->properties = properties;
 | 
						this->properties = properties;
 | 
				
			||||||
 | 
						this->id = SPA_ID_INVALID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("global %p: new %s", this,
 | 
						pw_log_debug("global %p: new %s", this,
 | 
				
			||||||
			spa_type_map_get_type(core->type.map, this->type));
 | 
								spa_type_map_get_type(core->type.map, this->type));
 | 
				
			||||||
| 
						 | 
					@ -236,6 +237,7 @@ void pw_global_destroy(struct pw_global *global)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug("global %p: destroy %u", global, global->id);
 | 
						pw_log_debug("global %p: destroy %u", global, global->id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (global->id != SPA_ID_INVALID) {
 | 
				
			||||||
		spa_list_for_each(registry, &core->registry_resource_list, link) {
 | 
							spa_list_for_each(registry, &core->registry_resource_list, link) {
 | 
				
			||||||
			uint32_t permissions = pw_global_get_permissions(global, registry->client);
 | 
								uint32_t permissions = pw_global_get_permissions(global, registry->client);
 | 
				
			||||||
			if (PW_PERM_IS_R(permissions))
 | 
								if (PW_PERM_IS_R(permissions))
 | 
				
			||||||
| 
						 | 
					@ -246,6 +248,7 @@ void pw_global_destroy(struct pw_global *global)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_list_remove(&global->link);
 | 
							spa_list_remove(&global->link);
 | 
				
			||||||
		spa_hook_list_call(&core->listener_list, struct pw_core_events, global_removed, global);
 | 
							spa_hook_list_call(&core->listener_list, struct pw_core_events, global_removed, global);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (global->properties)
 | 
						if (global->properties)
 | 
				
			||||||
		pw_properties_free(global->properties);
 | 
							pw_properties_free(global->properties);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue