diff options
author | SmallJoker <mk939@ymail.com> | 2021-08-03 20:26:00 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2021-08-03 20:29:55 +0200 |
commit | 4a3728d828fa8896b49e80fdc68f5d7647bf45b7 (patch) | |
tree | 2d208c0d0451c833bfe0fef23b43208efd1c4ecf /src | |
parent | bee50ca7fa0df561f7b65ff7099974085fb5f25e (diff) | |
download | minetest-4a3728d828fa8896b49e80fdc68f5d7647bf45b7.tar.gz minetest-4a3728d828fa8896b49e80fdc68f5d7647bf45b7.tar.bz2 minetest-4a3728d828fa8896b49e80fdc68f5d7647bf45b7.zip |
OpenAL: Free buffers on quit
Diffstat (limited to 'src')
-rw-r--r-- | src/client/sound_openal.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/sound_openal.cpp b/src/client/sound_openal.cpp index 8dceeede6..0eda8842b 100644 --- a/src/client/sound_openal.cpp +++ b/src/client/sound_openal.cpp @@ -362,6 +362,14 @@ public: for (auto &buffer : m_buffers) { for (SoundBuffer *sb : buffer.second) { + alDeleteBuffers(1, &sb->buffer_id); + + ALenum error = alGetError(); + if (error != AL_NO_ERROR) { + warningstream << "Audio: Failed to free stream for " + << buffer.first << ": " << alErrorString(error) << std::endl; + } + delete sb; } buffer.second.clear(); |