Delete underlying OpenAL source when a channel is stopped.
@@ -142,11 +142,16 @@ public:
{
clRemoveChannel(this);
- if (!openal_is_shutdown && sourceId && playing())
+ if (!openal_is_shutdown && sourceId)
+ {
+ if (playing())
{
alSourceStop(sourceId);
check("stop");
}
+ alSourcei(sourceId, AL_BUFFER, 0);
+ alDeleteSources(1, &sourceId);
+ }
sourceId = 0;
if (soundObject)
