Reset the target if the databuffer being deleted is currently selected

This commit is contained in:
Chris Robinson 2009-08-16 11:12:13 -07:00
parent 0b7eb9f118
commit 0b5a0d1e79

View File

@ -151,6 +151,11 @@ ALvoid ALAPIENTRY alDeleteDatabuffersEXT(ALsizei n, const ALuint *puiBuffers)
if(*list)
*list = (*list)->next;
if(ALBuf == Context->SampleSource)
Context->SampleSource = NULL;
if(ALBuf == Context->SampleSink)
Context->SampleSink = NULL;
// Release the memory used to store audio data
free(ALBuf->data);