mirror of https://github.com/ericonr/sndio.git
free buffers in dev_close(), delete midi port in dev_del()
This commit is contained in:
parent
3edbce0c18
commit
e7b81ffcd0
11
sndiod/dev.c
11
sndiod/dev.c
|
@ -1128,6 +1128,16 @@ dev_close(struct dev *d)
|
||||||
}
|
}
|
||||||
siofile_del(d->sio);
|
siofile_del(d->sio);
|
||||||
d->sio = NULL;
|
d->sio = NULL;
|
||||||
|
if (d->mode & MODE_PLAY) {
|
||||||
|
if (d->encbuf != NULL)
|
||||||
|
xfree(d->encbuf);
|
||||||
|
xfree(d->pbuf);
|
||||||
|
}
|
||||||
|
if (d->mode & MODE_REC) {
|
||||||
|
if (d->decbuf != NULL)
|
||||||
|
xfree(d->decbuf);
|
||||||
|
xfree(d->rbuf);
|
||||||
|
}
|
||||||
dev_clear(d);
|
dev_clear(d);
|
||||||
d->pstate = DEV_CFG;
|
d->pstate = DEV_CFG;
|
||||||
}
|
}
|
||||||
|
@ -1232,6 +1242,7 @@ dev_del(struct dev *d)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
midi_del(d->midi);
|
||||||
*p = d->next;
|
*p = d->next;
|
||||||
xfree(d);
|
xfree(d);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue