mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	module-session-manager: don't leak the impl structure
We need to remove the listener for the object as well so that we can safely free the impl memory.
This commit is contained in:
		
							parent
							
								
									2112a7287b
								
							
						
					
					
						commit
						3509962f3a
					
				
					 3 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -212,6 +212,7 @@ static void global_destroy(void *data)
 | 
			
		|||
	impl->global = NULL;
 | 
			
		||||
	if (impl->resource)
 | 
			
		||||
		pw_resource_destroy(impl->resource);
 | 
			
		||||
	free(impl);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct pw_global_events global_events = {
 | 
			
		||||
| 
						 | 
				
			
			@ -225,6 +226,7 @@ static void impl_resource_destroy(void *data)
 | 
			
		|||
	struct param_data *pdata, *tmp;
 | 
			
		||||
 | 
			
		||||
	spa_hook_remove(&impl->resource_listener);
 | 
			
		||||
	spa_hook_remove(&impl->stream_listener);
 | 
			
		||||
	impl->resource = NULL;
 | 
			
		||||
 | 
			
		||||
	/* clear cache */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue