mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa-device: cleanup in the free signal
Cleanup and close the plugin in the free signal so that the object has a chance to remove the event handlers from the object.
This commit is contained in:
		
							parent
							
								
									a0b2e5b498
								
							
						
					
					
						commit
						29d6179328
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -50,7 +50,7 @@ struct impl {
 | 
				
			||||||
	void *user_data;
 | 
						void *user_data;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void device_destroy(void *data)
 | 
					static void device_free(void *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct impl *impl = data;
 | 
						struct impl *impl = data;
 | 
				
			||||||
	struct pw_impl_device *device = impl->this;
 | 
						struct pw_impl_device *device = impl->this;
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@ static void device_destroy(void *data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const struct pw_impl_device_events device_events = {
 | 
					static const struct pw_impl_device_events device_events = {
 | 
				
			||||||
	PW_VERSION_IMPL_DEVICE_EVENTS,
 | 
						PW_VERSION_IMPL_DEVICE_EVENTS,
 | 
				
			||||||
	.destroy = device_destroy,
 | 
						.free = device_free,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pw_impl_device *
 | 
					struct pw_impl_device *
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -190,9 +190,9 @@ void pw_impl_device_destroy(struct pw_impl_device *device)
 | 
				
			||||||
	if (device->registered)
 | 
						if (device->registered)
 | 
				
			||||||
		spa_list_remove(&device->link);
 | 
							spa_list_remove(&device->link);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (device->device) {
 | 
						if (device->device)
 | 
				
			||||||
		spa_hook_remove(&device->listener);
 | 
							spa_hook_remove(&device->listener);
 | 
				
			||||||
	}
 | 
					
 | 
				
			||||||
	if (device->global) {
 | 
						if (device->global) {
 | 
				
			||||||
		spa_hook_remove(&device->global_listener);
 | 
							spa_hook_remove(&device->global_listener);
 | 
				
			||||||
		pw_global_destroy(device->global);
 | 
							pw_global_destroy(device->global);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue