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:
Wim Taymans 2025-07-22 14:00:09 +02:00
parent 74ad61f094
commit c3ec30dec7

View file

@ -242,7 +242,11 @@ fail:
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:
{
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_DmaBuf:
case SPA_DATA_SyncObj:
pw_log_debug("%p: close fd:%d", impl, (int)d->fd);
close(d->fd);
break;
default:
break;
}
}