client-node: only clear ports once

This commit is contained in:
Wim Taymans 2018-08-14 16:53:05 +02:00
parent 954da89756
commit d4ab36d52a

View file

@ -557,12 +557,16 @@ clear_port(struct node *this, struct port *port)
} }
if (port->direction == SPA_DIRECTION_INPUT) { if (port->direction == SPA_DIRECTION_INPUT) {
this->in_ports[port->id] = NULL; if (this->in_ports[port->id] == port) {
this->n_inputs--; this->in_ports[port->id] = NULL;
this->n_inputs--;
}
} }
else { else {
this->out_ports[port->id] = NULL; if (this->out_ports[port->id] == port) {
this->n_outputs--; this->out_ports[port->id] = NULL;
this->n_outputs--;
}
} }
} }