mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
stream buffers recycling fix
This commit is contained in:
parent
a5f0f0a780
commit
7cca53fca3
1 changed files with 7 additions and 0 deletions
|
|
@ -254,6 +254,13 @@ void ALSpeaker::stop() {
|
||||||
stopped = true;
|
stopped = true;
|
||||||
if (source) {
|
if (source) {
|
||||||
AL_CHECK(alSourceStop(source));
|
AL_CHECK(alSourceStop(source));
|
||||||
|
|
||||||
|
uint processed = AL::getSourcei(source, AL_BUFFERS_PROCESSED);
|
||||||
|
while (processed--) {
|
||||||
|
uint buffer;
|
||||||
|
AL_CHECK(alSourceUnqueueBuffers(source, 1, &buffer));
|
||||||
|
al->freeBuffer(buffer);
|
||||||
|
}
|
||||||
al->freeSource(source);
|
al->freeSource(source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue