From 8ae98ea54368a92021425b36b4efbd27ceb3f499 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 31 May 2022 16:13:40 +0100 Subject: [PATCH] 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. --- 3rdparty/iaxclient/lib/audio_openal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3rdparty/iaxclient/lib/audio_openal.c b/3rdparty/iaxclient/lib/audio_openal.c index 51ee457f0..033dd3f47 100644 --- a/3rdparty/iaxclient/lib/audio_openal.c +++ b/3rdparty/iaxclient/lib/audio_openal.c @@ -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; }