mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	device: add free signal
This commit is contained in:
		
							parent
							
								
									891bb49dfb
								
							
						
					
					
						commit
						973a92b49d
					
				
					 3 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -115,6 +115,7 @@ void pw_device_destroy(struct pw_device *device)
 | 
			
		|||
		spa_hook_remove(&device->global_listener);
 | 
			
		||||
		pw_global_destroy(device->global);
 | 
			
		||||
	}
 | 
			
		||||
	pw_device_emit_free(device);
 | 
			
		||||
	free((char *)device->info.name);
 | 
			
		||||
	pw_properties_free(device->properties);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,6 +56,8 @@ struct pw_device_events {
 | 
			
		|||
 | 
			
		||||
	/** the device is destroyed */
 | 
			
		||||
        void (*destroy) (void *data);
 | 
			
		||||
	/** the device is freed */
 | 
			
		||||
        void (*free) (void *data);
 | 
			
		||||
 | 
			
		||||
	/** the device info changed */
 | 
			
		||||
	void (*info_changed) (void *data, const struct pw_device_info *info);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -294,6 +294,7 @@ static inline void free_allocation(struct allocation *alloc)
 | 
			
		|||
 | 
			
		||||
#define pw_device_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_device_events, m, v, ##__VA_ARGS__)
 | 
			
		||||
#define pw_device_emit_destroy(m)		pw_device_emit(m, destroy, 0)
 | 
			
		||||
#define pw_device_emit_free(m)			pw_device_emit(m, free, 0)
 | 
			
		||||
#define pw_device_emit_info_changed(n,i)	pw_device_emit(n, info_changed, 0, i)
 | 
			
		||||
 | 
			
		||||
struct pw_device {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue