mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 04:12:39 +00:00
* Fix leaking OpenAL buffers (Amanieu)
This commit is contained in:
parent
18b27806bc
commit
53adde9fb2
1 changed files with 12 additions and 0 deletions
|
@ -1396,6 +1396,8 @@ S_AL_StreamDie
|
||||||
static
|
static
|
||||||
void S_AL_StreamDie( int stream )
|
void S_AL_StreamDie( int stream )
|
||||||
{
|
{
|
||||||
|
int numBuffers;
|
||||||
|
|
||||||
if ((stream < 0) || (stream >= MAX_RAW_STREAMS))
|
if ((stream < 0) || (stream >= MAX_RAW_STREAMS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1404,6 +1406,16 @@ void S_AL_StreamDie( int stream )
|
||||||
|
|
||||||
streamPlaying[stream] = qfalse;
|
streamPlaying[stream] = qfalse;
|
||||||
qalSourceStop(streamSources[stream]);
|
qalSourceStop(streamSources[stream]);
|
||||||
|
|
||||||
|
// Un-queue any buffers, and delete them
|
||||||
|
qalGetSourcei( streamSources[stream], AL_BUFFERS_PROCESSED, &numBuffers );
|
||||||
|
while( numBuffers-- )
|
||||||
|
{
|
||||||
|
ALuint buffer;
|
||||||
|
qalSourceUnqueueBuffers(streamSources[stream], 1, &buffer);
|
||||||
|
qalDeleteBuffers(1, &buffer);
|
||||||
|
}
|
||||||
|
|
||||||
S_AL_FreeStreamChannel(stream);
|
S_AL_FreeStreamChannel(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue