Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OpenAL: Free buffers on quit
  • Loading branch information
SmallJoker committed Aug 3, 2021
1 parent bee50ca commit 4a3728d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/client/sound_openal.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 4a3728d

Please sign in to comment.