From 487f0dde7593144ceabd817306500465caf7602a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 16 Aug 2009 16:11:22 -0700 Subject: [PATCH] Print source and auxiliary slot debug warnings from alcDestroyContext --- Alc/ALc.c | 16 ++++++++++++++-- OpenAL32/alAuxEffectSlot.c | 5 ----- OpenAL32/alSource.c | 5 ----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index a807ef47..1528c4e6 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1174,8 +1174,20 @@ ALCAPI ALCvoid ALCAPIENTRY alcDestroyContext(ALCcontext *context) // Lock context SuspendContext(context); - ReleaseALSources(context); - ReleaseALAuxiliaryEffectSlots(context); + if(context->SourceCount > 0) + { +#ifdef _DEBUG + AL_PRINT("alcDestroyContext(): deleting %d Source(s)\n", context->SourceCount); +#endif + ReleaseALSources(context); + } + if(context->AuxiliaryEffectSlotCount > 0) + { +#ifdef _DEBUG + AL_PRINT("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", context->AuxiliaryEffectSlotCount); +#endif + ReleaseALAuxiliaryEffectSlots(context); + } context->Device->Context = NULL; diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index eac415df..acefb624 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -447,11 +447,6 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context) { -#ifdef _DEBUG - if(Context->AuxiliaryEffectSlotCount > 0) - AL_PRINT("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", Context->AuxiliaryEffectSlotCount); -#endif - while(Context->AuxiliaryEffectSlot) { ALeffectslot *temp = Context->AuxiliaryEffectSlot; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index de85451c..205a1c46 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2137,11 +2137,6 @@ static ALint GetByteOffset(ALsource *pSource) ALvoid ReleaseALSources(ALCcontext *Context) { -#ifdef _DEBUG - if(Context->SourceCount > 0) - AL_PRINT("alcDestroyContext(): deleting %d Source(s)\n", Context->SourceCount); -#endif - while(Context->Source) { ALsource *temp = Context->Source; -- 2.11.4.GIT