mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	client-node: close SyncObj fd as well
We also need to close the SynObj fd we got, just like we close any DmaBuf or MemFd. Make sure we get a compiler error when we add more items to the data type enumeration later. Fixes #4807
This commit is contained in:
		
							parent
							
								
									0833b0e790
								
							
						
					
					
						commit
						d23b479aaf
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
					@ -242,7 +242,11 @@ fail:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void clear_data(struct impl *impl, struct spa_data *d)
 | 
					static void clear_data(struct impl *impl, struct spa_data *d)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	switch (d->type) {
 | 
						switch ((enum spa_data_type)d->type) {
 | 
				
			||||||
 | 
						case SPA_DATA_Invalid:
 | 
				
			||||||
 | 
						case SPA_DATA_MemPtr:
 | 
				
			||||||
 | 
						case _SPA_DATA_LAST:
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
	case SPA_DATA_MemId:
 | 
						case SPA_DATA_MemId:
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		uint32_t id;
 | 
							uint32_t id;
 | 
				
			||||||
| 
						 | 
					@ -258,11 +262,10 @@ static void clear_data(struct impl *impl, struct spa_data *d)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	case SPA_DATA_MemFd:
 | 
						case SPA_DATA_MemFd:
 | 
				
			||||||
	case SPA_DATA_DmaBuf:
 | 
						case SPA_DATA_DmaBuf:
 | 
				
			||||||
 | 
						case SPA_DATA_SyncObj:
 | 
				
			||||||
		pw_log_debug("%p: close fd:%d", impl, (int)d->fd);
 | 
							pw_log_debug("%p: close fd:%d", impl, (int)d->fd);
 | 
				
			||||||
		close(d->fd);
 | 
							close(d->fd);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		break;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue