From 705c60d924f37a1c6ec99a472d0396c47291d3f0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 30 Aug 2014 20:59:46 -0700 Subject: Use al_calloc/al_free to allocate contexts and voices --- Alc/ALc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index 8d5cef32..ae31ad87 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -2158,7 +2158,7 @@ static void FreeContext(ALCcontext *context) } ResetUIntMap(&context->EffectSlotMap); - free(context->Voices); + al_free(context->Voices); context->Voices = NULL; context->VoiceCount = 0; context->MaxVoices = 0; @@ -2170,7 +2170,7 @@ static void FreeContext(ALCcontext *context) //Invalidate context memset(context, 0, sizeof(ALCcontext)); - free(context); + al_free(context); } /* ReleaseContext @@ -2875,7 +2875,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin return NULL; } - ALContext = calloc(1, sizeof(ALCcontext)+sizeof(ALlistener)); + ALContext = al_calloc(16, sizeof(ALCcontext)+sizeof(ALlistener)); if(ALContext) { InitRef(&ALContext->ref, 1); @@ -2885,7 +2885,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin ALContext->VoiceCount = 0; ALContext->MaxVoices = 256; - ALContext->Voices = calloc(ALContext->MaxVoices, sizeof(ALContext->Voices[0])); + ALContext->Voices = al_calloc(16, ALContext->MaxVoices * sizeof(ALContext->Voices[0])); } if(!ALContext || !ALContext->Voices) { @@ -2898,12 +2898,12 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin if(ALContext) { - free(ALContext->Voices); + al_free(ALContext->Voices); ALContext->Voices = NULL; VECTOR_DEINIT(ALContext->ActiveAuxSlots); - free(ALContext); + al_free(ALContext); ALContext = NULL; } -- cgit v1.2.3