1
0
Fork 0

IAXClient OpenAL: clean up our buffers

Avoid a console warning from OpenAL-soft about leaked buffers on
shutdown, by ensuring IAXClient backend does matching cleanup 
for the buffers it allocates.
This commit is contained in:
James Turner 2022-05-31 16:13:40 +01:00
parent d571bc6f76
commit 8ae98ea543

View file

@ -246,10 +246,16 @@ int openal_destroy(struct iaxc_audio_driver *d)
{
struct openal_priv_data* priv = (struct openal_priv_data*)(d->priv);
alcCaptureStop(priv->in_dev);
alcCaptureCloseDevice(priv->in_dev);
alDeleteSources(1, &priv->source);
// FlightGear: added by James to avoid a warning from OpenAL-soft
// when we destroy the context in SGSoundMgr_OpenAL: since we
// genBuffers below, we should balance that out.
alDeleteBuffers(priv->num_buffers, priv->buffers);
return 0;
}