OpenAL: Free buffers on quit

This commit is contained in:
SmallJoker 2021-08-03 20:26:00 +02:00
parent bee50ca7fa
commit 4a3728d828

@ -362,6 +362,14 @@ public:
for (auto &buffer : m_buffers) { for (auto &buffer : m_buffers) {
for (SoundBuffer *sb : buffer.second) { 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; delete sb;
} }
buffer.second.clear(); buffer.second.clear();