Skip to content
Permalink
Browse files
OpenAL: Free buffers on quit
  • Loading branch information
SmallJoker committed Aug 3, 2021
1 parent bee50ca commit 4a3728d828fa8896b49e80fdc68f5d7647bf45b7
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/client/sound_openal.cpp
@@ -362,6 +362,14 @@ class OpenALSoundManager: public ISoundManager

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();

0 comments on commit 4a3728d

Please sign in to comment.