From 1b9d740244de7b217c7d3382a7dc3f9bf4c7f403 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 18 Jan 2008 00:56:01 -0800 Subject: Remove duplicated source freeing code --- Alc/ALc.c | 20 -------------------- OpenAL32/alSource.c | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index 5ff7a91c..08944700 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -402,26 +402,6 @@ static ALvoid InitContext(ALCcontext *pContext) */ static ALCvoid ExitContext(ALCcontext *pContext) { - unsigned int i; - ALsource *ALSource; - ALsource *ALTempSource; - -#ifdef _DEBUG - if (pContext->SourceCount>0) - AL_PRINT("alcDestroyContext() %d Source(s) NOT deleted\n", pContext->SourceCount); -#endif - - // Free all the Sources still remaining - ALSource = pContext->Source; - for (i = 0; i < pContext->SourceCount; i++) - { - ALTempSource = ALSource->next; - ALTHUNK_REMOVEENTRY(ALSource->source); - memset(ALSource, 0, sizeof(ALsource)); - free(ALSource); - ALSource = ALTempSource; - } - //Invalidate context pContext->LastError = AL_NO_ERROR; pContext->InUse = AL_FALSE; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index f48ef304..ec1db1a4 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2297,6 +2297,7 @@ ALvoid ReleaseALSources(ALCcontext *Context) Context->Source = Context->Source->next; // Release source structure + ALTHUNK_REMOVEENTRY(temp->source); memset(temp, 0, sizeof(ALsource)); free(temp); } -- cgit v1.2.3