mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	pw-link: avoid crash when proxy was already destroyed
When a link already exists, the link will fail and the proxy will be destroyed and the pointer set to NULL. Avoid doing things with the NULL pointer when cleaning up.
This commit is contained in:
		
							parent
							
								
									c48c444566
								
							
						
					
					
						commit
						cdfe95c091
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		|  | @ -842,8 +842,11 @@ static void data_clear(struct data *data) | |||
| 
 | ||||
| 	struct target_link *tl; | ||||
| 	spa_list_consume(tl, &data->target_links, link) { | ||||
| 		if (tl->proxy != NULL) { | ||||
| 			spa_hook_remove(&tl->listener); | ||||
| 			spa_hook_remove(&tl->link_listener); | ||||
| 			pw_proxy_destroy(tl->proxy); | ||||
| 		} | ||||
| 		spa_list_remove(&tl->link); | ||||
| 		free(tl); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans