From 075b3da90988ae8b6cd627cb3bce6edd1e34d6da Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 28 Sep 2013 20:44:50 +0200 Subject: [PATCH] fix condition to check if a midi port is referenced --- sndiod/midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sndiod/midi.c b/sndiod/midi.c index 4a20ba2..a52a77b 100644 --- a/sndiod/midi.c +++ b/sndiod/midi.c @@ -492,7 +492,8 @@ port_unref(struct port *c) #endif for (rxmask = 0, i = 0; i < MIDI_NEP; i++) rxmask |= midi_ep[i].txmask; - if ((rxmask & ~c->midi->self) == 0 && c->state == PORT_INIT && !c->hold) + if ((rxmask & c->midi->self) == 0 && c->midi->txmask == 0 && + c->state == PORT_INIT && !c->hold) port_drain(c); }